• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Please help display "Post VIew Counter" on Genesis

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Please help display "Post VIew Counter" on Genesis

This topic is: not resolved
  • This topic has 4 replies, 2 voices, and was last updated 7 years, 6 months ago by Brad Dalton.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • September 15, 2015 at 9:24 am #165585
    wparrow
    Member

    Hi all experts!
    I just installed plugin Post View Counter and want to display the View counter via entry-meta area, please look at my site: http://www.couponab.com/

    But the problem is I don't known how to let the View Counter display at the same line with entry-meta info when I am using the plugin short code to display [post-views].

    Here is the answer from plugin owner:

    You can style it via CSS, display inline or inline-block, or just use pvc_get_post_views( $post->ID ) to just get the views without any styling.

    so I guest the code is: <?php echo pvc_get_post_views(); ?>

    and here is the code to display meta-info via my functions.php file

    add_filter( 'genesis_post_info', 'sp_post_info_filter' );
    function sp_post_info_filter($post_info) {
    	$post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit] ';
    	return $post_info;
    }

    As you saw on my site, I am using short code to display post view counter
    $post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit] [post-views]';

    I am not too familiar with php – any advice would be greatly appreciated!

    http://www.couponab.com/
    September 15, 2015 at 9:45 am #165594
    Brad Dalton
    Participant

    Did you try adding the post views shortcode to your filter function?


    Tutorials for StudioPress Themes.

    September 15, 2015 at 12:36 pm #165615
    wparrow
    Member

    Hi Braddalaton

    What I mean is how to display the View counter at the same line with "Time", "Leave a comment" on my site

    I've already use the short code "post-views" via filter function but I get custom style from plugin, the plugin author telling me just use php code <?php echo pvc_get_post_views(); ?> without additional style .

    But I don't known how to insert <?php echo pvc_get_post_views(); ?> into the functions.php file

    Thanks

    September 19, 2015 at 9:35 am #166084
    wparrow
    Member

    Anyone please help

    September 20, 2015 at 2:51 am #166120
    Brad Dalton
    Participant

    Yes, understand and think you have 2 options.

    1 is to create a shortcode and add it to the filter

    The other is to use the plugins shortcode in the filter


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble