WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
[Plugin: WordPress Popular Posts] Request use of wp_enqueue (5 posts)

  1. alturnwall
    Member
    Posted 2 years ago #

    Couldn't find other contact info, so listing here.

    Would it be possible to see use of wp_enqueue_script() and wp_enqueue_style() in a future release of this?

    I'd be willing to help out with some code updates if you're looking for any collaborators.

    Thanks!

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hi alturnwall,

    The wp_enqueue_style function has been implemented already on the development version (not released yet as I'm still reworking some stuff and adding new features).

    About wp_enqueue_script, where should it be applied to?

  3. alturnwall
    Member
    Posted 2 years ago #

    Hector, thanks for getting back to both of my posts, and thanks for the great plugin!

    Looking forward to the dev version, and idea when we might be able to grab that code? Or can I get it now from the subversion repo?

    You're right, wp_enqueue_script should not be used—I was digging through a few plugins all at once and incorrectly copied and pasted that comment here also.

    Thanks again.

  4. Texiwill
    Member
    Posted 2 years ago #

    Hello,

    I just implemented this as well.... I did the following:

    after line 123 I added:

    // Enqueue Style Sheet
                            if (function_exists('wp_enqueue_style')) {
                                    wp_register_style( 'wpp-css', plugins_url('style/wpp.css', __FILE__) , array(), $version);
                                    wp_enqueue_style( 'wpp-css' );
                            }

    And then in wpp_print_stylesheet I modified it to be the following, in this way the older functionality is available if necessary.

    // still needed if no enqueue
                            if (!function_exists('wp_enqueue_style')) {
                                    $css_path = (@file_exists(TEMPLATEPATH.'/wpp.css')) ? get_stylesheet_directory_uri().'/wpp.css' : plugin_dir_url( __FILE__ ).'style/wpp.css';
                                    echo "\n"."<!-- WordPress Popular Posts v".$this->version." -->"."\n".'<link rel="stylesheet" href="'. $css_path .'" type="text/css" media="screen" />'."\n"."<!-- End WordPress Popular Posts v".$this->version." -->"."\n";
                            }

    -- Edward

  5. Héctor Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    Hi guys,

    @alturnwall the dev version isn't public yet as it still needs a lot of work.

    @Texiwill thanks for sharing your code!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic