- This topic has 7 replies, 2 voices, and was last updated 5 years, 6 months ago by
Tom.
-
AuthorPosts
-
November 10, 2019 at 6:57 am #1058674
Jesse
Hi, I am including category meta info in the page hero of my posts, and this works fine. Trouble is, I don’t want that meta info to link to the category archive pages. How can I achieve this? Thanks in advance!
November 10, 2019 at 8:12 am #1058702David
StaffCustomer SupportHi there,
simplest way would be this CSS to remove the pointer event on the link:
.page-hero h2 a { pointer-events: none; }Then in the Header Element you change the Link color to white.
October 16, 2020 at 1:57 pm #1492537webmasterla-montgolfiere-fr
Hi,
Great work ! Generatepress is great !
Do you have an idea in order to delete the tag / category “a href”.
Many thanks !
October 17, 2020 at 11:14 am #1493502Tom
Lead DeveloperLead DeveloperRemoving the href completely would be difficult, but you could use the same method David used:
.cat-links a, .tags-links a { pointer-events: none; }October 19, 2020 at 9:22 am #1495825webmasterla-montgolfiere-fr
Many thanks for the reply. No solution ? Snippet code or create a child theme ?
Many thanks again !October 19, 2020 at 1:13 pm #1496163Tom
Lead DeveloperLead DeveloperYou could try this:
add_filter( 'generate_category_list_output', function() { return sprintf( '<span class="cat-links">%3$s<span class="screen-reader-text">%1$s </span>%2$s</span> ', esc_html_x( 'Categories', 'Used before category names.', 'generatepress' ), strip_tags( get_the_category_list( ', ' ) ), apply_filters( 'generate_inside_post_meta_item_output', '', 'categories' ) ); } ); add_filter( 'generate_tag_list_output', function() { return sprintf( '<span class="tags-links">%3$s<span class="screen-reader-text">%1$s </span>%2$s</span> ', esc_html_x( 'Tags', 'Used before tag names.', 'generatepress' ), strip_tags( get_the_tag_list( '', ', ' ) ), apply_filters( 'generate_inside_post_meta_item_output', '', 'tags' ) ); } );October 20, 2020 at 7:45 am #1497037webmasterla-montgolfiere-fr
Many thanks Tom 🙂
But it seems not working. Links still.
Many thanks again !October 20, 2020 at 1:46 pm #1497631Tom
Lead DeveloperLead DeveloperHmm,
strip_tags()removes all HTML, including the link.Any other similar functions on the site?
-
AuthorPosts
- You must be logged in to reply to this topic.