Im building a website with wordpress, using a child theme. there is a file in the main theme folders, called entry.php that is where I need to add a bit of php at the bottom of this document.
I don't want to touch the parent theme files, to avoid problems when I update the theme.
How can I embed/insert PHP code in that specific file/ part of the code?
Is this done using filters? embed? can you please guide me I have been searching in google but I dont know if im using the right keywords to search.
Im learning php and this would be of great help :)
Further details:
Ideally I want this bit of code to be embedded right before the end of the "/section"
<?php if (in_category('3')) { ?>
<div class="recommended-bottom">
<h3 class="recommended-title">WRITING</h3>
<?php echo do_shortcode('[pt_view id="343aa4f4c3"]');?>
</div>
<?php }else { ?>
<?php } ?>
The code in entry.php is:
<article <?php post_class(); if( ! is_single() ) echo ' itemprop="blogPost"'; ?> itemscope itemtype="http://schema.org/BlogPosting">
<?php shiroi_get_post_view( 'parts/header', get_post_format() ); ?>
<?php shiroi_get_post_view( 'media/media', get_post_format() ); ?>
<section class="entry-content post-content" itemprop="articleBody">
<?php do_action( 'shiroi_before_post_body_content' );
if( is_single() || 'the_content' === shiroi_get_option( 'blog_summary' ) ) :
the_content( __( 'Continue Reading', 'shiroi' ) );
else:
the_excerpt();
printf( '<div class="more-link-wrap"><a href="%s" class="more-link">%s</a></div>', esc_url( get_permalink() ), esc_html__( 'Continue Reading', 'shiroi' ) );
endif;
if( is_single() ):
if( get_the_tags() && shiroi_get_option( 'blog_show_tags' ) ):
?><p class="post-tags">
<?php the_tags( '<i class="fa fa-tags"></i>', ', ' ); ?>
</p>
<?php endif;
wp_link_pages(array(
'before' => '<nav class="entries-page-nav"><ul>',
'after' => '</ul></nav>',
'separator' => '',
'pagelink' => '<span class="entries-page-nav-item">%</span>'
));
endif;
do_action( 'shiroi_after_post_body_content' ); ?>
</section>
<?php if( is_single() ) :
shiroi_get_post_view( 'parts/footer', get_post_format() );
shiroi_get_post_view( 'parts/comments', get_post_format() );
endif; ?>
</article>