WordPress.org

Forums

WordPress Popular Posts
[resolved] Enable PHP for own HTML in widget (7 posts)

  1. mdidesign
    Member
    Posted 1 year ago #

    Hey,

    is there a way to enable PHP within the widget, when using own HTML? Would be really nice - it is already possible for the usual TEXT-widget of WordPress - how about enabling it for this plugin, too?

    Regards

    https://wordpress.org/plugins/wordpress-popular-posts/

  2. Hector Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi there,

    No, that can't be done since the WPP widget can't parse PHP functions / scripts - and I won't add such a feature because: 1. it'll make things overly complicated, and 2. because you already can do something like this to modify the standard HTML output. With it, you could call PHP functions as well. Make sure you read the entire topic as it contains info that you should be aware of.

  3. mdidesign
    Member
    Posted 1 year ago #

    I decided to use the customized TEXT-widget of WordPress to achieve what I want. I am using "wpp_get_mostpopular()" and all those tags together with a shortcode which contains all PHP that I need.

  4. mdidesign
    Member
    Posted 1 year ago #

    By the way: How much does this plugin affect the load time of the website? As far as I can see the plugin catches every single view of a post? Does´nt this slows down the entire website?

  5. Hector Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    As far as I can see the plugin catches every single view of a post?

    Yep, otherwise how would the plugin track page views?

    Does´nt this slows down the entire website?

    Nope, updating the views count should be fairly quick on most websites.

  6. mdidesign
    Member
    Posted 1 year ago #

    Yes, thanks for your feedback. Unfortunately all kind of views are counted - I don´t know if it were bots or crawlers but even when no real visitor visited my site, I saw that views were counted. There should be something like an intelligent filter here - just like in Google Analytics, where those bots are also not counted (for at least 90% or so).

  7. Hector Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Yep, I'm aware of that. I posted a simple workaround here that should keep most bots out the statistics for the time being until WPP 3.0 is ready.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Popular Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.