ob_get_flush
doesn’t do what you think it does. You’re assuming that it only ends the output buffer and returns its contents, which is incorrect, it also flushes the output buffer to the browser.
So this:
return ob_get_flush();
Is the same as this:
$content = ob_get_clean();
echo $content;
return $content;
Use ob_get_clean();
instead, which erases the output buffer instead of flushing it.
Related Posts:
- Prevent Archive URLs
- How to Check if a Page Exists by URL?
- Must permalinks always point to single post pages?
- How to allow slashes in single posts when i click in the edit permalink button
- Link for the page archive for posts, like using custom post types with get_post_type_archive_link
- change default post archive page link
- WordPress not opening posts with only numbers if permalink is post_name
- Trying to use AngularJS with WordPress without any API
- Permalink doesn’t get displayed in Twitter button (Local WordPress problem?)
- Retrieve post ID from “querying” URL
- Second get_permalink inside loop points to wrong URL
- Post is blank when I click on the link
- Can Permalink structure of %postname%/%post_id% improve performance
- Can I show category name in url for only one of my categories?
- How can I make a post sub link?
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- How to add a ‘News’ section to specific posts in WordPress
- Category URL to use same string as Post URL Permalink
- Post & Category Archives URL structure
- How to change post template via url?
- My posts section for logged in user
- Make assigning post to a specific category equivalent to assigning it to all categories
- Show all posts in category
- Default post type doesn’t display in url
- Blog posts are not appearing as subs of Blog Page
- How to add paraent in Blog post URL in wordpress
- Where is the old post permalink slug stored?
- Difference between an archive and a page listing posts
- Query *only* sticky posts
- Create an “All Posts” or “Archives” Page with WordPress 3.0?
- Can’t show comments count per post outside loop
- Some posts returning 404 instead of displaying post
- Alternate custom content in the loop
- get_permalink executes link without https
- Auto Refresh Post List after X seconds
- Create pretty permalink for a post knowing the permalink structure
- Link post permalinks to subdirectory /post
- Display posts with comments closed, with pagination?
- Remove permalink from images when inserting into post
- Remove the Edit button in posts for permalinks on certain user roles? WP 3.3
- Plain permalinks not working!
- Guest Author – How to display posts on /author/ archive page
- WordPress Loop – Next 3 Posts
- How to check a post exist when the permalink has post id in it?
- How to do set post permalinks using 6 digit random unique function?
- Pulling in post category and children within category
- Any way for get_next_post() to use the actual post order instead of publish order?
- How to exclude visited posts from loop
- How to display excerpt post on hamepage and archive pages?
- Why does WP_Post not contain its permalink?
- add to end of post in the loop with plugin
- Custom Permalink Structure for Pages & Posts
- Add custom text automatically on each post
- Display current post position in Elementor Posts widget
- singular posts using archive styling
- Post/page title to permalink transformation – what is behind the scenes?
- Some doubts about how the loop work (trying debugging it)
- If custom field is empty, use one from a previous post
- Get post category as a separate string and url
- Making posts permalinks consistent numbers
- I can’t find the relevant part of the loop in my theme file. How do I find the full content with “More…”
- How to view all posts (on site, not admin) that are uncategorized?
- How to link post titles on page A to its posts on page B?
- How to show full post on home page
- ACF flexible content block not showing on live site (works locally)
- Only the most recent post is showing on my category page (working on localhost, not live site)
- My post permalinks are redirecting to the post archive page for some reason?
- WP posts using index.php instead of single.php
- Change WordPress names duplicate titles (url)
- Get posts from category from custom query
- Can I Paginate Post after every 25 tag?
- How do I generate formatted permalinks as specified in backend options?
- Alternative content between posts no repetition
- Start loop from specific post ID
- Display new posts categories in separated divs
- Permalink base only for posts
- If I moved the location of my generic “posts” page, do I need to change the slugs for all of the individual posts?
- Problem with wp_insert_post()
- How to control Post view count incresing in sidebar widget posts too?
- WordPress URL question
- post_name is not stored until post is published… where should I store my slug until it goes live then?
- WordPress loop uses unmodified posts array, why?
- Add row after three columns
- How to retrieve a post by inputing the url in a custom field and displaying it on an options page
- Modify WordPress loop after it has been run
- Skip posts, but keep posts per page
- index.php is only displaying current month’s posts?
- Loop doesn’t display posts. It displays a link to the home page instead
- Grab next post title in archive page
- Getting posts from multiple users?
- How to organise post by category and date
- Show post if in category
- Displaying categories items among posts
- How do I display the next 3 posts in the sidebar?
- Choose options via url
- First post in loop displays twice
- Wrap every 2 posts
- Add author section on Author archive posts
- What function does the loop of displaying posts?
- Change permalinks in posts via SQL