What’s the Best Way to Structure a Multi-Content Blog?

Your sites look nothing alike. Open those three links – and there is not a single element that binds all three sites together. Network of sites can benefit from consistent looks. You could use global “about” page that covers all of your activity and not just bits in context of specific site. Consider building landing … Read more

Where to hook into post content?

You can use the_content with an high prioriety (lower number). add_filter( ‘the_content’, function( $content ) { return ‘Hello World ‘.$content; }, 0); You can even use negative priority: add_filter( ‘the_content’, function( $content ) { return ‘Hello World ‘.$content; }, -10); Note that this will apply everytime ‘the_content’ is used, no matter the post type, or … Read more

remove tags from the_content

By default, WordPress adds paragraph tags to category descriptions. Stop this by adding the following to your functions.php file // Remove p tags from category description remove_filter(‘term_description’,’wpautop’); Simple and easy (codeless). Thank you

if the post has content

The content is a property of the post object, not of the query object. Use $post or get_post() instead: if( ” !== get_post()->post_content ) { // do something }

How can I keep the content of my pages version controlled?

You already got something like this built in: Revisions. // Define the nr of saved revisions in your wp-config.php define( ‘WP_POST_REVISIONS’, 30 ); You can simply grab them by calling get_posts() with a post_type of revision. To show the difference between two revisions simply use wp_text_diff(). // Example $revisions = get_posts( array( ‘post_type’ => ‘revision’ … Read more

How to show page content in feed?

First set the post type to display on main feed page i.e. /feed using pre_get_posts hook $q->set(‘post_type’, array(‘post’, ‘page’)); On individual page WordPress shows comment feed then set it to false and display page content in feed. $q->is_comment_feed = false; In feed template WordPress calls the_excerpt_rss() which calls get_the_excerpt() so using excerpt_length filter change the … Read more