• 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

WP-Postviews & Simple Edits

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 › WP-Postviews & Simple Edits

This topic is: not resolved
  • This topic has 6 replies, 4 voices, and was last updated 11 years, 10 months ago by mattgoyer.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • March 17, 2013 at 11:56 pm #28780
    mattgoyer
    Member

    I'm trying to use the wp-postviews plugin with the Simple Edits plugin. What I've done is create a shortcode in my child theme's functions file:

    function post_views() {
    return the_views();
    }
    add_shortcode('views', 'post_views');

    But when I use the shortcode in Simple Edits post meta: [post_categories]  [views]

    It displays it on a different line that the post_categories. How do I get it to appear on the same line?

    Or if you have another way to show post views I'm all ears :).

    March 23, 2013 at 12:07 pm #30740
    weslinda
    Member

    Do you have a link to this?  Did you figure this out?


    Loving the Genesis Life!

    March 23, 2013 at 1:45 pm #30763
    AnitaC
    Keymaster

    Maybe try it this way - use the Meta snippets instead of the Simple Edits - http://my.studiopress.com/snippets/post-meta/.


    Need help with customization or troubleshooting? Reach out to me.

    March 26, 2013 at 9:56 pm #31454
    mattgoyer
    Member

    I haven't solved it yet. Though Studiopress support had this to say:

    I'm not familiar with that plugin but my guess is the_views() automatically echos the content instead of returning it. You would need a function (possibly get_the_views()) that would return the value.

    March 28, 2013 at 12:07 am #31677
    mattgoyer
    Member

    Studiopress support was right. It was echoing it and not returning it. Adding a false to the function returns the value.

    So this now works for me:

    function post_views() {
    return the_views(false);
    }
    add_shortcode(‘views’, ‘post_views’);

    September 9, 2014 at 10:47 am #123599
    rcorai
    Member

    Hi Matt,

    I tried with the code you posted here but it doesn't work for me. I'm seeing [views] tag instead of a number. Could you explain me a bit more how did you make it work?

    Thanks,

    September 9, 2014 at 11:46 am #123608
    mattgoyer
    Member

    Hi there, sorry but I don't recall :(. /

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 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

© 2026 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