Define a name to the posts slug

Set your permalink structure to custom and use: /post/%postname%/ Then when registering your custom post types use something like this: ‘rewrite’ => array( ‘slug’ => ‘something’, ‘with_front’ => false ), Using with_front set to false will make sure that your new custom post types don’t share the /post/ part of your permalink structure

Latest 5 posts (custom post type), each post different CSS

First setup a WP_Query to fetch the latest 5 posts from your custom post type “apps”. You also need to update a “counter” for each post in the loop. Then simply echo the count in the class for the div. <?php //Query posts $query = new WP_Query(array( ‘post_type’ => ‘apps’, ‘posts_per_page’ => 5 )); //Reset … Read more

Blogroll – Different layout for first post

Creating 2 queries for your scope is absolutely an not need work… Use only one query and use the $wp_query->current_post property to change the output of first post.. $args = array ( ‘pagination’ => true, ‘paged’ => $paged, ‘posts_per_page’ => ’10’, ‘ignore_sticky_posts’ => true, ‘order’ => ‘DESC’, ‘orderby’ => ‘date’, ); // The Query $query … Read more

Planned private posts get published immediately

The problem is that changing the post visibility to private invokes a status change, in a way private is not only a visibility but also a publishing status. Or to quote the WordPress Codex, section »Content Visibility – Private Content«. Once you change the visibility to private, the post or page status changes to “Privately … Read more

the_posts filter been called multiple time

‘the_posts’ is an action fired everytime WP_Query get posts, for main query and for other secondary queries, so when you do something like: $foo = new WP_Query($args); in a widget or elsewhere (shortcode, related posts…) ‘the_posts’ is triggered again. However there is only one main query, so you can use a conditional and do what … Read more

Does an article (post) id ever change?

No they don’t change, but you shouldn’t rely on them for external sites. If we’re talking about purely in the database on an individual WordPress site, then: If it’s a published/established post/page then yes, the ID will not change other than to delete it If its a revision, a draft, etc the ID won’t change, … Read more