WordPress.org

Support

Support » Plugins and Hacks » where to add code in single.php and index.php

where to add code in single.php and index.php

  • Hi

    Im have installed Vote it up, but need to add code in my single.php and index.php to make it work.

    i found them in editor under appearance, but where should i copypaste the code?

    <?php DisplayVotes(get_the_ID()); ?>

    all the best
    Mads Hallas

Viewing 5 replies - 1 through 5 (of 5 total)
  • If you want it to display right after the post content, just look for a line that mentions ‘the_content’ and add it after. It really just depends on the theme though.

    cool that worked in the single.php 🙂

    but where should i put it in the index.php

    index.php should have a similar function in there – if not, what do you have in there?

    <?php get_header(); ?>

    <div id=”centercol” class=”grid_10″>
    <?php if (get_option(‘woo_show_blog’) == false) { ?>

    <?php include(TEMPLATEPATH . ‘/includes/featured.php’); ?>

    <?php

    $layout = get_option(‘woo_layout’);

    include(‘layouts/’.$layout);

    ?>

    <?php } else { include(TEMPLATEPATH . ‘/includes/stdblog.php’); } ?>

    </div><!–/centercol–>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    That structure is a bit different than that of a standard template. It seems to be referencing another file for the layout – from that code I cannot tell which file from the ‘layouts’ directory it is referencing – perhaps it is in the options? But you could try looking through that folder.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘where to add code in single.php and index.php’ is closed to new replies.