1. HOT Divi Ultimate Header Plugin - More variety for your Divi header: https://header.diviultimate.com/
This is the support forum for Divi Ultimate Child Theme.

To access this support forum, you need to purchase Divi Ultimate Child Theme.

If already purchased, kindly login to your account to access it.
For Divi community forum, kindly visit here: https://divi.help/forums/get-help-on-divi-wordpress.30/

Solved Include tags in blog post

Discussion in 'Basic Support Forum' started by sossyw, May 17, 2020.

  1. sossyw

    sossyw Member
    Divi Ultimate Child Theme

    Hi,

    I am wanting to include a list of the article's tags at the top of each blog post, but I can't see a setting where I make this appear.

    I have attached a screenshot of another person's blog to give you an idea of what I am wanting to achieve in respect to the position and look.

    Thanks for your help.
     

    Attached Files:

    1. AD Speed up your Divi site with Divi specific cache plugin: https://divi.help/link-forums/divi-rocket.160/
  2. Divi Ultimate

    Divi Ultimate Administrator
    Staff Member

    Are you using our Divi Ultimate Blog Post feature? It doesn't have built-in option to display post tags.

    But you may try the below PHP code in your child theme functions.php:
    Code:
    function tags_before_single_post_content($content) {
      $posttags = get_the_tags();
      if ($posttags) {
        $array = [];
        foreach($posttags as $tag) {
          $array[] = '<a href="/tag/' . $tag->slug . '/">' . $tag->name . '</a>';
        }
        $content = '<div class="container"><div class="et_pb_row">Tags: ' . implode(', ', $array) . '</div></div>' . $content;
      }
      return $content;
    }
    add_filter( 'the_content', 'tags_before_single_post_content');
    
    It will display the post tag before the post content.

    But if you built your post template with Divi Theme Builder, then you can just add a text module & click the below:

    upload_2020-5-18_14-47-50.png

    upload_2020-5-18_14-48-18.png
     
  3. sossyw

    sossyw Member
    Divi Ultimate Child Theme

    Thank you for your help.
     
    1. AD Feature-rich Divi eCommerce Child Theme for WooCommerce: https://divi.help/link-forums/royalcommerce.151/

Recommended Divi Hosting