0

I'm using the Jetpack plugin for related items and social sharing. Both of these options filter the_content and append themselves to the end of it. The problem is that I'm using custom navigation in my posts which I output by using this code above and after the_content in my single.php.

<div class="navigare">  
    <?php multipagebar(); ?>
    <div class="dropdown">
        <?php TA_content_jump(1); ?> 
    </div>
</div>  

I know that to append something to the_content I can use a filter:

add_filter('the_content', function($content)
{
    return 'text-to-append' . $content;
});

My question and problem is: how to append the navigation PHP functions so that they display before the related and social sharing items of Jetpack?

1 Answer 1

1

You will need to experiment with priority.

add_filter(
  'the_content', 
  function($content) {
      return 'text-to-append' . $content;
  },
  10 // this is a priority number; 10 is default
);

The "10" is the default priority. I don't know what number JetPack uses but your original code, without a priority, should run at "10" so I'd try "9", or "8". It should be possible to get your code to execute before JetPack's code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.