Output string using php printf

the_content() prints it output to screen. What you want is to return that output and assign a variable to it. You should note, although get_the_content() do exactly what you want, it only returns unfiltered content, and not filtered content like the_content(). You should manually add those filters, which is real easy. You can do the … Read more

Replace full content with an excerpt

Decide about the_excerpt() or the_content() with a conditional: is_singular(). You can use a plugin and filter the_content depending on the current page’s type: archive or singular. But you can use it in your theme too. add_filter( ‘the_content’, ‘t5_replace_content_with_excerpt’, 100 ); /** * Return excerpt if we are not on a singular post view. * * … Read more

Does is_user_logged_in() block search bots?

If you wrap some content in a is_user_logged_in() condition, all that content will only be rendered to users who have an account on your website and are logged into that account. Now, do Google bots have an account on your website? Hell no. So no, that content will never be indexed by Google in your … Read more

How to make multiple page out of one post

You can use the WordPress”nextpage” tag: <!–nextpage–> You just drop this into the HTML of your WordPress page wherever you want to break it up. I think your theme must support this tag in order to handle the pagination – on my site I have page “previous/next” links hidden, but most themes probably support this … Read more

What is the proper way to get contents of a page?

A few notes before I start NEVER EVER use php shortcodes, they are bad, confusing and not supported by default on some servers. IMHO, they should have never made it into PHP in the first place. WordPress Standards (which doesn’t mean much) also “prohibits” the use of shorttags. Use proper php tags and forget that … Read more