• I’m using a magazine style theme so I added social icons in front of every post on index.php. Live example: intech-bb.com! Now what I want is to add one more social icon but in front of specific post, let’s say post number 6. How can I do that? Because if I add a social icon code in index.php it implements on every post on index.php. Can someone please help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • I didn’t fully understand your question but maybe you can use an if statement to achieve that.So you use something like

    if(post id=”1″) {
    your-function
    }

    Ofcourse you would need to make your own function.

    Thread Starter BBilal

    (@bbilal)

    Okay I’ll try to explain in brief! Below is the code for showing post on the main page:

    <!–begin of magazine style–>
    <div id=”post-<?php the_ID(); ?>” class=”postbox”>

    <div class=”post-thumb”>
    <?php tj_show_thumb(‘boxthumbw’, ‘boxthumbh’); ?>
    </div> <!–end .post-thumb–>

    <h2>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></h2>

    <div class=”post-exerpt”>
    <?php if(get_theme_mod(‘post_social’)==’Yes’):?>
    <div class=”post_social”>
    <div class=”digg”>
    ” data-count=”vertical” data-via=”<?php echo get_theme_mod(‘twitter_id’); ?>”>Tweet<script type=”text/javascript” src=”https://platform.twitter.com/widgets.js”></script&gt;
    </div>
    <div class=”facebook”>
    <iframe src=”https://www.facebook.com/plugins/like.php?href=&lt;?php the_permalink();?>&layout=box_count&show_faces=true&width=50&action=like&font=arial&colorscheme=light&height=65″ scrolling=”no” frameborder=”0″ style=”border:none; overflow:hidden; width:50px; height:65px;” allowTransparency=”true”></iframe>
    </div>
    <div class=”google”>
    <g:plusone size=”tall”></g:plusone>
    </div>
    </div>
    <?php endif;?>
    <?php the_post_excerpt(); ?>
    <p class=”byline clearfix reviewer vcard”>
    <span title=”<?php the_time(‘F j, Y’); ?>” class=”date dtreviewed”><?php the_time(‘F j, Y’); ?> by <?php the_author_posts_link(); ?></span>
    <span class=”comment-count”><img src=”<?php bloginfo(‘template_directory’); ?>/images/comment.png” alt=”Comments” style=”vertical-align:middle” />?<?php comments_popup_link(__(‘0 ‘, ‘qlogixsolutions’), __(‘1 ‘, ‘qlogixsolutions’), __(‘% ‘, ‘qlogixsolutions’)); ?></span>
    </p>
    </div> <!–end .post-excerpt–>

    <div class=”clear”></div>

    </div> <!–end .postbox–>

    In the whole code the bold code is for social icons. Now see the screenshot below:

    https://i54.tinypic.com/2rnycy0.jpg

    The bold code creates the social icons highlighted in the above screenshot! Now what I want is to add another social icon but on selected posts only not on all posts as if the bold code is generating social icons for posts!

    I hope you got it now!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add Additional Thing In Post Page’ is closed to new replies.