Custom URL for all posts in WordPress

Create a page with a custom page template, then create a custom WP_Query object to return your last posts. You can get something like: <?php /* Template Name: Blog Page */ get_header(); $args = array( ‘post_type’ => ‘any’, #all post types ‘posts_per_page’ => 10 #get 10 posts ); $query = new WP_Query( $args ); if($query->have_posts()): … Read more

Detect archive and category page

There are Conditional Tags for this: is_archive() and is_category() respectively. For a custom post type archives you could use is_post_type_archive(). There are many conditional tags available, see above linked codex page. To determine the blog archive you have to additionally check for the post type post, take a look at this question and the answers … Read more

Keep WYSIWYG on Blog Page

Pre WP 4.9 if( ! function_exists( ‘fix_no_editor_on_posts_page’ ) ) { /** * Add the wp-editor back into WordPress after it was removed in 4.2.2. * * @param Object $post * @return void */ function fix_no_editor_on_posts_page( $post ) { if( isset( $post ) && $post->ID != get_option(‘page_for_posts’) ) { return; } remove_action( ‘edit_form_after_title’, ‘_wp_posts_page_notice’ ); add_post_type_support( … Read more

Show first sentence of blog post in blog roll

Assuming you want to cut off a string after the first full stop you could use something like this: $the-content = “This is the first sentence. And this is the second”; $cut-in-two = explode(‘.’, $the-content, 2); $first-sentence = $cut-in-two[0];

Two Blog Layouts, Same Theme

YES! You need 2 custom templates. One for standard view for your visitors and second for your review printout. But you need to create also for that second printout page header and footer manualy and also some functionality. You can’t use the same head and footer from other pages. Or you can but you then … Read more