Support

Account

Home Forums Front-end Issues Display social buttons after custom fields Reply To: Display social buttons after custom fields

  • Most of these plugins add their output by adding a filter to “the_content”. Some of these plugins give alternate ways of adding their output so that you can place it where you want, some don’t. That would depend on the plugin and you’d need to check the plugin or with the plugin author.

    Your other choices are to add your own filter to “the_content” that runs at a lower priority than theirs or to not use the_content() to display the content of the page and run the filter yourself.

    
    // option 1 - add filter to the_content
    // low priority so it runs before other filters
    // you'll probably need to adjust the priority to get it to work
    add_filter('the_content', 'my_content_filter', 1);
    function my_content_filter($content) {
      // generate your content and add it to $content
      $content .= 'whatever content you generated';
      return $content;
    }
    
    
    // option 2, run the_content filter yourself
    $content = $post->post_content;
    // generate your content and add it to $content
    $content .= 'whatever content you generated';
    apply_filters('the_content', $content);
    

    But the best bet is to look at the other plugin and find a way to alter what it’s doing using whatever filters or functions that they provide.