• Hi
    I have a problem on my site. I have three plugins that show after content which is easy social share, facebook comments and similar articles from the theme panel. As you can see on http://techsmessage.com/wearable-tech-4k-really-need/ it shows it in the order social, comment, similar articles. I want it to show social, similar articles and then comments, how do i do this?

Viewing 1 replies (of 1 total)
  • They are probably showing in the order they appear in your admin panel “Plugins” page.

    When a WordPress page is rendered (put together for final output); WordPress goes through the list of plugins; and adds any hooks or filters in the order they are found (alphabetically).

    Using Priority Parameter
    The developers, when hooking to ‘the_content()’, can set a priority number as the third argument of the action call.

    So you get something like add_action('the_content', 'test_function', 100).

    [More Info]

    Manual Workaround
    If you know the name of the function used in the action hook; you can write a function in your child theme to 1) Remove the action hook, 2) Re-Fire the action hook with the third argument added.

    So, if your Easy Social Share is using `easy_social_content’ as the action hook name hooked to “the_content” filter; we could do this:

    remove_action('the_content', 'easy_social_content');
    add_action('the_content', 'easy_social_content', 100);

    Do this for each of the three plugins; and change the priority argument to be the sequence you wish them to appear.

    Since a child theme code is executed last (after the theme and after all plugins are loaded)… this code will execute last… and will give you the order you desire.

    Good Luck 🙂
    Lemme know how you do.

Viewing 1 replies (of 1 total)

The topic ‘After content plugins in wrong order’ is closed to new replies.