Is there a way to alter the order in which the plugins appear in the page?

I currently have the following plugins activated in my wordpress installation:

row 1:

Read More

Outbrain

row 2:

Subscribe via feedburner RSS/email

row 3:

Topsy tweet widget, FB like widget, WP-Email a friend widget

I want to change the order in which they appear.

I want widgets in row 3 to appear first, outbrain widget to appear last, in row 3. How do i achieve this?

Although I can fiddle a little bit with PHP if the solution requires, I prefer an independent plugin to take care of the ordering if there exists one!

Thanks!

Related posts

Leave a Reply

1 comment

  1. From your comment it looks like you almost got it,

    Plugins that add something under your content usually use the_content filter by calling a function using add_filter for example outbarin plugin calls it like this:

    add_filter('the_content', 'outbrain_display');
    

    so the way your can order them is by passing the priority parameter

    add_filter('the_content', 'outbrain_display',99); 
    

    But changing it directly on the plugin’s files is not the right way since next time you will update the plugin you will lose these changes, so the right way to do it is to add an action after the plugins were loaded using the plugins_loaded action hook and remove the filters they added and then re add this filters using your desired order:

    add_action('plugins_loaded','my_content_filters_order');
    function my_content_filters_order(){
        //first remove the filter call of the plugin
        remove_filter('the_content', 'outbrain_display');
        //... Do that for all filters you want to reorder
        //... ex: remove_filter('the_content', 'FB_like');
    
        //then add your own with priority parameter
        add_filter('the_content', 'outbrain_display',99);
        //... Do that for all filters just removed and set
        //... the priority accordingly 
        //...  Lower numbers correspond with earlier execution
        //... ex: add_filter('the_content', 'FB_like',98);
        //... this will run first then outbrain
    }
    

    hope this helps