The content is manipulated by the get_the_content
function, and that function always assumes the current post in the Loop. You can’t pass it an ID, strangely.
The easiest way to get just the bit before the more for an arbitrary post ID is:
$p = get_post(1);
$p = preg_split( '/<!--more(.*?)?-->/', $p->post_content );
echo $p[0];
There may be ways to hijack the global
$post
variable but unless you really need the complex manipulation of get_the_content
I wouldn’t bother. You can always create a near clone of that function that will allow you to pass an ID into it.
Related Posts:
- Manual excerpts for pages not working on Search
- How to get post or page excerpt using post_excerpt
- How do I modify this page template to show subpage excerpts (not post excerpts)?
- How to create wordpress page that shows posts with specific tags?
- How to exclude shortcode from specific page IDs if it’s set to global
- How to echo excerpts with wp_list_pages?
- How to make tag post listing page working?
- Any Ideas for Including “More Tag” with get_pages($args)?
- Read more on pages WordPress
- How to get tagged pages to show up with tagged posts?
- Query pages based on tags
- Archive limit the text of the_content
- trying to add a author value in wp page links?
- Attach link to pages accoding to tags
- Search Page: activate html code if the tag is on the page
- Display inner pages like posts.[Like how post excerpt works]
- How to get sort content by page id?
- Create page excerpts for landinpage
- How to add an excerpt and read more link to a page?
- simple category search form returns full text – but I need excerpts
- Static front page with excerpt
- Tags are automatically converted if they match post names. Stop It!
- Display list of posts with x tag within a page?
- Custom wp_list_pages() function
- Add tags to long page that is broken up into subpages?
- How to get a list of pages (not posts) with specific tags?
- How can I keep the content of my pages version controlled?
- How to load JS and CSS only on specific Pages using is_page()?
- Listing pages which uses specific template [duplicate]
- How do I convert a page’s title to lower case?
- page title, parent tilte and grand parent title
- How to add jQuery script to an individual page?
- How do I set and list page_template with wpcli?
- Different fields in My Profile page depending on user role
- Object gets unwanted width and height
- WP is not using the select custom template.php that its selected for a page
- Is it possible to set a page template on a dynamic home page (articles list)?
- What’s the most minimal way in which a page can be hooked into WP?
- Associate Page with User
- Limit the number of pages created by the paging
- One page – Multiple parents?
- Check whether the child page has siblings
- How to re-order pages en-masse
- wp_dropdown_pages default value
- Creating custom page
- How to create a metabox that will list all my pages in a dropdown selector?
- Personal page for every user (not just authors)
- Relative instead of absolute links in pages?
- Produce a plain page with only a message
- load common thank you template with different content for different pages
- Password Protected Page Title
- Send mail from page using wp_mail
- “more” tag doesn’t appear when browsing category achives or search
- Page displays content from different query?
- Site url is not showing the home page
- Can’t locate a hidden private page
- Making audio playlist by getting page’s parent’s ID
- Restricting Pages based on Hierarchy and User Role
- page-name.php doesn’t execute on custom template
- How to retrieve attachments from child pages of a specific Page?
- how to display sidebar on pages in wordpress
- page.php is not called, falls back to index.php
- Custom page in archive page for certain category
- I would like my page editor to be sorted by date created, or updated, instead of in Alpha order, is this possible?
- Show FormCraft form on page open [closed]
- Why last blog post excerpt is shown instead of meta description? [closed]
- Prevent non-admin to add/create new pages
- How do you implement a page template automatically being applied to a page?
- Make “default” wordpress pages & features unaccessible
- Set a variable to using in redirected page
- Show parent & child pages with featured image and hide the current page
- Publish page by invoking submit via jQuery
- One author not showing in Author drop down list while editing page
- WordPress Page Protect forwards to Admin Login
- How can I edit pages from my local environment?
- Modifying .page-content background image
- “Can’t update in WordPress”
- Why can’t pages be categorized / tagged?
- Pages in wp-admin is not found 404
- Shortcode runs when editing page
- Cannot figure out how to add a read more link to a manual excerpt. Please help
- List of pages of a specific user
- WordPress dosn’t save page/post updates
- Multiple meta_key with get_pages
- Sup pages can’t be found
- How to use wp_dropdown_pages or wp_list_pages to accomplish a menu like this?
- Send e-mail from admin area to adresses in custom field
- Bundle a page with custom url and a function
- Custom Upload Adds Ghost File
- How to exclude sidebar from pages?
- Widget & storing a Select box choice
- How to Change the path of a child page?
- disable trashability for certain pages
- If searched in a category show different 404 page
- pages won’t show on front page using loop or pre_get_posts
- How can I cycle posts with a #next and #previous script?
- Using Page/Post Slug In Link / URL
- List of pages – AJAX load more
- How do I count the number of pages a user has seen on my site, and force them to log in after a certain amount
- Fresh WordPress installation not able to simply show page content