Adding list of all blogs to single blog view

hey. I need to add list of all blogs when viewing a single blog, so that the user can access the other blogs easily (currently we just show the most recent 3 on home page, then click through to single view, and here we have next/last at the bottom of the blog)

I would normally update single.php to achieve this…how do I do this safely within Pro?

Hello @doughballs,

Thanks for writing in!

Before you modify anything, please check out this knowledge base article:

If you want to modify the single page, assuming that you have your child theme active and ready, please follow these steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file

<?php

// =============================================================================
// VIEWS/RENEW/WP-SINGLE.PHP
// -----------------------------------------------------------------------------
// Single post output for Renew.
// =============================================================================

$fullwidth = get_post_meta( get_the_ID(), '_x_post_layout', true );

get_header();

?>

  <div class="x-container max width offset">
    <div class="<?php x_main_content_class(); ?>" role="main">

      <?php while ( have_posts() ) : the_post(); ?>
        <?php x_get_view( 'renew', 'content', get_post_format() ); ?>
        <?php x_get_view( 'global', '_comments-template' ); ?>
      <?php endwhile; ?>

    </div>

    <?php if ( $fullwidth != 'on' ) : ?>
      <?php get_sidebar(); ?>
    <?php endif; ?>

  </div>

<?php get_footer(); ?>

Off course, please do not forget to add your modifications as well. I am using Renew stack since in your site, you are using this stack.

3] Save the file named as wp-single.php
4] Upload this file to your server in the child theme’s folder wp-content/themes/pro-child/framework/views/renew/

You will need to create the folder path since it does not exist yet in your child theme.

We would love to know if this has worked for you. Thank you.

Hey @RueNel

This is perfect, just what I needed and works great. I’ve added my post loop code for anyone that might stumble across this same feature request:

<?php
    $args = array(
        'post_type' => 'post'
    );

    $post_query = new WP_Query($args);
if($post_query->have_posts() ) {
  while($post_query->have_posts() ) {
    $post_query->the_post();
    ?>
    <a href="<?php the_permalink(); ?>"><?php the_title(); ?>&nbsp;|&nbsp;<?php echo get_the_date(); ?></a><br>
    <?php
  }
} wp_reset_postdata();
?>

Thanks for sharing and glad it’s working now!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.