Add custom meta to top post meta in inFocus?

resolved (7 posts) (2 voices)

  1. Hello!
    I have already managed to modify existing top-meta-fields (see http://greyarium.com/2011/06/elle/).
    What I didn't manage to do is add this custom meta into top meta on single post page):

    WP-PostViews plugin (http://wordpress.org/extend/plugins/wp-postviews/installation/)

    <?php if(function_exists('the_views')) { the_views(); } ?>

    It worked in inFocus 1.6 before update, but the updated inFocus coding has changed and now the method proposed by the author of this plugin (as I did in previous infocus) doesn't work.

    I'll be very thankful for your help!

    Posted 7 months ago #
  2. Elliott
    Support

    Hello Greya,

    Are you wanting it to display on your single posts? Try adding it beneath line 22 in /wp-content/themes/[your_theme]/single.php.

    Posted 7 months ago #
  3. I've already tried this - I've managed to put it everywhere except where I need :)

    I'd like to put it inside top-meta after the 'number of comments', so it looks like this:
    ___________________________________________________________
    "Jun 9 2011 | People, Women | 0 Comments | 43 views"
    ___________________________________________________________

    Thanks!

    Posted 7 months ago #
  4. Elliott
    Support

    Try opening up /wp-content/themes/infocus/framework.php and change line 612 from this,

    $out .='<p class="post_meta">' . $meta_output . '</p>';

    To this,

    $out .='<p class="post_meta">' . $meta_output . the_views() . '</p>';

    Posted 7 months ago #
  5. I've also tried different variations of what you proposed before asking my question here, and every time it adds "the views" to the new paragraph like in screenshot below.
    In inFocus 1.6 I just added the code proposed by the plugin-authors and placed it just after the code for number of comments - it worked okay..

    Attachments

    1. the_views.png (7.6 KB, 0 downloads) 7 months old
    Posted 7 months ago #
  6. Elliott
    Support

    It must be echoing out the values. Try this,

    $out .='<p class="post_meta">' . $meta_output . the_views(false) . '</p>';

    Or opening up the plugin file, wp-postviews.php, and changing line 145 from this,

    function the_views($display = true, $prefix = '', $postfix = '', $always = false) {

    to this,

    function the_views($display = false, $prefix = '', $postfix = '', $always = false) {

    Posted 7 months ago #
  7. The first variant worked, so I didn't even try the second one :)
    Thanks a lot!

    Posted 7 months ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme