• Hi,

    I have 2 different “Share on Facebook” buttons I want included in posts, but I dont want to copy paste the code into each post, in case I want to change the code at some point in the future.

    Therefore I was wondering if there is an easy way to include the code in my posts? I have tried a shortcode plugin called shortcoder, but it broke the code. Any ideas?

Viewing 1 replies (of 1 total)
  • In your theme you probably have a file called single.php. Copy it into your child theme and add your code there. Then it will show up on every single post page.

    For example:

    <?php /* The loop */ ?>
    <?php while ( have_posts() ) : the_post(); ?>
    
    	<?php get_template_part( 'content', get_post_format() ); ?>
              PLACE YOUR CODE HERE
    	<?php twentythirteen_post_nav(); ?>
    	<?php comments_template(); ?>
    
    <?php endwhile; ?>

Viewing 1 replies (of 1 total)
  • The topic ‘How to easy insert code in each post’ is closed to new replies.