• I have this bit of code that I only want to show on the post page itself and not in the front page. I don’t have a single.php file in my theme.

    Here is the code:

    <div class="social">
     <div style="margin-bottom:38px; float:left;"><a href="https://twitter.com/share" class="twitter-share-button" data-text="<?php the_title(); ?>" data-url="<?php the_permalink() ?>" data-count=”vertical” data-via="itstheblock">Tweet</a><script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script></div> 
    
    <div style="float:right;">
    <iframe src="https://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:400px; height:60px"></iframe></div>
    </div>

    This is the sitehere

Viewing 1 replies (of 1 total)
  • <?php if( !is_home() && !is_front_page() ) : ?>
    <div class="social">
     <div style="margin-bottom:38px; float:left;"><a href="https://twitter.com/share" class="twitter-share-button" data-text="<?php the_title(); ?>" data-url="<?php the_permalink() ?>" data-count=”vertical” data-via="itstheblock">Tweet</a><script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script></div> 
    
    <div style="float:right;">
    <iframe src="https://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:400px; height:60px"></iframe></div>
    </div>
    <?php endif;?>
Viewing 1 replies (of 1 total)
  • The topic ‘Content to only show on page, not frontpage’ is closed to new replies.