What is a page or post id according to WordPress post shortcode?
-
As the insruction given at the WordPress’ Support Site about how to use [ display-posts ] shortcode to show specific post ID (or multiple post IDs), the instruction then given thus: <font color=”green”>[ display-posts id=”1,14 ]</font> without reaving space between [ and display, the same with 1,14 and ]; then the page or post will show those specific posts provided by IDs.
So I tried with the following to display two pages in one page:
<font color=”green”>[ display-posts post_type=”page” include_content=”true” id=”page1,page2″ wrapper=”div” ]</font> <font color=”red”>NOTE: without leaving any space between [ or ] and inside words</font>
This failed and displayed only the shortcode itself, but after reforcing it by updating the page without any change, it showed only a blank page. So I edited the same page and changed from <font color=”green”>id=”page1,page2″</font> to <font color=”green”>page_id=”page1,page2″</font>, this displayed all the pages in my blog site and not specific pages. So where I was wrong with this? Or what is meant by the term id here? Is it an url ending like /page1, /page2 or is it another thing?
The blog I need help with is: (visible only to logged in users)
-
Hi,
For pages:
See the How to Find the Page ID section of the Pages support page. It says: “You can find the Page ID in the Edit Page URL,” and provides an example.For posts:
A post ID is basically found the same way as you would a page ID, except that it will be found in the Edit Post URL. -
Thanks.
Seems like that the page id is not a “Slug”? so I was wrong when I tried to use a slug as an id of a page or post.
Can you help me found a direct link to Edit Page Url section?; for when I try to edit any page through the wp-admin, I don’t see that option
-
Hi,
In WP Admin, the “Edit Page URL” just means the address (URL) of a page editor. So a WP Admin page editor on your site will have an address such as https://sabbathlight.wordpress.com/wp-admin/post.php?post=ID#&action=edit, where instead of “ID#” there will be a number.
Another convenient way of to view page IDs is to go to the WP Admin Pages page, https://sabbathlight.wordpress.com/wp-admin/edit.php?post_type=page, which can be found via the path WP admin dashboard menu (far right) > Pages > All Pages, and then hover over any page title. When you do so, the page ID will display at the very bottom of the browser window, bottom left if you’re using a device with a large screen.
-
-
- The topic ‘What is a page or post id according to WordPress post shortcode?’ is closed to new replies.