WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack Post Views
[resolved] Where to put the count-views code? (4 posts)

  1. VittorioC93
    Member
    Posted 7 months ago #

    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/

  2. VittorioC93
    Member
    Posted 7 months ago #

    Ok, I've found the way!
    Thanks ;)

  3. Andrew
    Forum Moderator
    Posted 7 months ago #

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

  4. VittorioC93
    Member
    Posted 7 months ago #

    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();
    }

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.