How to replace single.php in child theme

Hi,

I have a developer helping me with some modifications, but he is stuck understanding where to put some modified files to make them work.

Specifically -
“There is a file named “wp-single.php” in renew folder in parent theme.
I made a copy of that file and put that in renew folder in child theme and modified the container class in that, which is working, http://2016.bristolvineyard.com/2017/03/05/when-the-world-shakes-part-4/
See, now it’s full width. But, this file is calling another view from inside it that renders the post that I am trying to identify?”

Please could you help me understand what file renders the post view and what to name the replacement and where to place it in the child theme?

Thanks for your help.

Mark

Hi there Mark,

In the wp-single.php for renew which is this:

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

?>

<?php 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(); ?>

Where you see:

 <?php x_get_view( 'renew', 'content', get_post_format() ); ?>
 <?php x_get_view( 'global', '_comments-template' ); ?>

This means that pro/framework/renew/content.php is called and also the global comments template, depending on the exact modifications you want to make, you’ll need to also edit that renew content template then place that in the child theme in the same location.

Thanks!

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