• Hello,

    I have a custom taxonomy named “t”.

    It’s displayed on my posts using strip_tags() so they won’t be clickable.

    This is what I have on my PHP template:

    $terms_as_text = get_the_term_list( $post->ID, 't', '', ', ', '' ) ;
    echo strip_tags($terms_as_text);

    Now, I would like to do the same for the Query Loop Block: When I add my custom taxonomy to a Query Loop Block, I want them to not be clickable.

    I believe this very easy to achieve, but I am self-taught and not a pro at PHP.

    I am using a child theme for Twenty Twenty One Theme.

    If someone could help me please to create a function for my functions.php file, I’d be so grateful!

    Cheers!

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m not certain I understand. Do you mean you don’t want the title of the post/page to be a link? If so you can toggle that functionality in the block settings by making sure “Make title a link”, is toggled off.

    Thread Starter Laly York

    (@lalyry)

    “a custom taxonomy”

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to use strip_tags() for Query Loop Block in functions.php’ is closed to new replies.