Sidebar on single.php not showing up

It seems that the sidebar checks whether or not the Post Layout is set to “content”. If you remove that check, it should operate the way the main index page does. Editing / commenting out the following lines in sidebar.php should solve the problem (if not, get you closer): Find: if ( ‘content’ != $current_layout … Read more

how to redirect to a custom post template

If you CPT is called “work“, i.e. you have registered it using register_post_type(‘work’, $args); you have to create a file called ‘single-work.php’ and that will be used to show the singular work post. If you don’t create that file the file ‘single.php’,if present, will be used by WordPress. If even the ‘single.php’ does not exist … Read more

get current page number with wp_link_pages()

wp_link_pages depends on four globals— $page, $numpages, $multipage, and $more. I cannot test this right now, but if I remember correctly $page is the current page and $numpages is the total number of pages. All you should need is: global $page; echo $page;

What hook can I use to modify custom post data before it is displayed on the page?

You can use the_content filter to modify content before it’s output. function my_the_content_filter( $content ) { // maybe limit to archive or single cpt display? if( is_post_type_archive( ‘your-cpt’ ) || is_singular( ‘your-cpt’ ) ){ global $post; $meta = get_post_meta( $post->ID, ‘some-key’, true ); if( false === $meta ){ return $content . ‘some extra content’; } … Read more

Sort All Posts by Category Name in the Admin Panel?

zip, you might need to save your category as a new post meta first, that’s how orderby meta_value works. Not sure if this could help, I stumbled upon this plugin: http://wordpress.org/plugins/custom-post-order-category/, it could let you specified a category then order posts in that category. If you’re curious about how to save category into a post … Read more