0

Is there a way to edit the page that shows all your posts? But not affect the specific categorized pages? I have been trying, and cannot seem to find a solution.

  • Depending on how your site is configured, index.php is likely driving your list of posts, the blog 'home'. Your theme likely contains a category.php template as well which renders the category pages. – jdm2112 Aug 31 '15 at 15:16
  • Yes there is. Hard for anyone to say without seeing your site/code but have a look at developer.wordpress.org/themes/basics/template-hierarchy – Will Aug 31 '15 at 17:46
0

You can create a Page template in which display all posts with your custom markup.

<?php

/**
 * Template Name: My Custom Blog
 *
 */

// The Query
$args = array('posts_per_page'=>-1);
$the_query = new WP_Query( $args );

// The Loop
if ( $the_query->have_posts() ) {
    echo '<ul>';
    while ( $the_query->have_posts() ) {
        $the_query->the_post();
        echo '<li>' . get_the_title() . '</li>';
    }
    echo '</ul>';
} else {
    // no posts found
}
/* Restore original Post Data */
wp_reset_postdata();

?>

Name this page as: "page-custom_blog.php" After, just publish a new page assigning this template.

Assigning  a page template

Hope it helps.

https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.