Support » Plugin: Jetpack Post Views » Where to put the count-views code?

  • Resolved VittorioC93

    (@vittorioc93)


    Hi 🙂
    I’m having troubles putting the code in the functions.php , can you help me? I would really appreciate it..
    I’m talking about this code: <?php echo get_post_meta( $post->ID, 'jetpack-post-views', true ); ?>
    and I think to have to put it here

    // New PostFooter
    function replacement_postfooter($postfooter) {
    global $id, $post;
    
    if ($post->post_type == 'page' && current_user_can('edit_posts')) { /* For logged-in "page" search results */
    $postfooter = '<div class="entry-utility">' . thematic_postfooter_posteditlink();
    $postfooter .= "</div><!-- .entry-utility -->\n";
    } elseif ($post->post_type == 'page') { /* For logged-out "page" search results */
    $postfooter = '';
    } else {
    if (is_single()) {
    $postfooter = '<div class="entry-utility">' . thematic_postfooter_postcategory() . thematic_postfooter_posttags();
    } else {
    $postfooter = '<div class="entry-utility">' . thematic_postfooter_postcomments() . thematic_postfooter_postcategory() . thematic_postfooter_posttags();
    }
    $postfooter .= "</div><!-- .entry-utility -->\n";
    $postfooter .= '<div class="divider"> </div>';
    return $postfooter;
    }
    }
    add_filter('thematic_postfooter','replacement_postfooter');

    but I don’t know how nor where! 🙁

    I hope you do, thanks a lot!
    P.S. Beautiful plugin, I needed it!

    http://wordpress.org/plugins/jetpack-post-views/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Ok, I’ve found the way!
    Thanks 😉

    Moderator Andrew Nevins

    (@anevins)

    Forum moderator

    Hi Vittorio, out of interest how did you resolve this?

    Here’s the code! 🙂

    $postfooter = '<div class="entry-utility">' . get_post_meta( $post->ID, 'jetpack-post-views', true ) . thematic_postfooter_postcategory() . thematic_postfooter_posttags();
    } else {
    $postfooter = '<div class="entry-utility">' . get_post_meta( $post->ID, 'jetpack-post-views', true ) . thematic_postfooter_postcomments() . thematic_postfooter_postcategory() . thematic_postfooter_posttags();
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Where to put the count-views code?’ is closed to new replies.