Home Forums SEA WordPress Theme Displaying Tags on Portfolio grid

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #20994
    lew-egr
    Participant
    Purchased

    Hi. I would like to assign tags to portfolio projects. I can get the tag input panel to display in the admin, and assign tags to projects using the following code snippet in functions.php:

    /* Add tags to portfolio backend*/
    
    function reg_tag() {
    	register_taxonomy_for_object_type('post_tag', 'ux-portfolio');
    }
    add_action('init', 'reg_tag');

    and using:

    $posttags = get_the_tags();
    if ($posttags) {
      foreach($posttags as $tag) {
        echo $tag->name . ' '; 
      }
    }

    to display them on the front end.

    But what i can’t do is insert them where i would like, and assigned to each project.

    My portfolio grid displays the featured image, with title, category and date beneath. I would like to display tags beneath the date.

    Looking at the files – plugins/bm-builder/include/templates/modules/module-grid.php is where i need to add the code (below line 665?), but i need help in formating it correctly.

    Can anyone help?

    Many thanks

    #21001
    SeaTheme
    Keymaster
    Purchased

    Hi,

    Could you please leave your Portfolio grid page URL? I need to know what’s the layout.
    ps: if you change the php file in the plugin, it will be covered after plugin update.

    Regards!

    SeaTheme – SeaTheme.netTwitterFacebook

    #21003
    lew-egr
    Participant
    Purchased
    This reply has been marked as private.
    #21019
    SeaTheme
    Keymaster
    Purchased

    Hi,

    Thanks for the information.

    Looking at the files – plugins/bm-builder/include/templates/modules/module-grid.php is where i need to add the code (below line 665?), but i need help in formating it correctly.

    Yes, it is correct.
    I added it on this file https://www.dropbox.com/s/yqa282s1e8e90sn/qq20200422-154956.jpg?dl=0

    Besta

    #21023
    lew-egr
    Participant
    Purchased

    Hi, that works great thank you. One thing i should have specified was that i would like to display them in an unordered list so each tag can be individually styled (within a bordered box with margin between).

    I’ve tried all sorts of permutations from here https://developer.wordpress.org/reference/functions/the_tags/ but had no luck

    Thanks again.

    #21024
    SeaTheme
    Keymaster
    Purchased

    Hi,

    Welcome
    It is a deep custom job. It is not included in the free support. I can only give you the basic suggestion.

    Regards!

    SeaTheme – SeaTheme.netTwitterFacebook

    #21031
    lew-egr
    Participant
    Purchased

    Hi. No problem. Got it working in the end using:

    $posttags = get_the_tags();
    if ($posttags) {
    $html.= '<div class="grid-item-date"><ul class="tag-list">';
      foreach($posttags as $tag) {
        $html.= '<li>'.$tag->name.'</li>'; 
      }
    $html.= '</ul></div>';
    }

    and some CSS.

    Thanks again

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.

Join Newsletter(FREE)

Subscribe to our newsletter to receive news & updates. We promise to not spam you, super promise!