-
AuthorPosts
-
December 13, 2020 at 2:27 am #1266842
I need to remove the link from the post title, on a single post, from the source code, so basically to remove the tag, see here for better understanding:
https://prnt.sc/w1gl3lNeed to leave h1 only, without the inner tag wrapping the title.
Thank you.
December 14, 2020 at 5:34 am #1267022Hey sammilo4,
Do you need it to just not be clickable?
Best regards,
Jordan ShannonDecember 15, 2020 at 2:32 pm #1267480December 15, 2020 at 2:41 pm #1267481see here:
https://kriesi.at/support/topic/remove-permanent-link-from-the-post-h1-title/#post-1220155
this to your child-theme functions.php:function avia_default_title_filter($current_post) { if(!empty($current_post['title'])) { $default_heading = is_singular() ? 'h1' : 'h2'; $args = array( 'heading' => $default_heading, 'extra_class' => '' ); /** * @since 4.5.5 * @return array */ $args = apply_filters( 'avf_customize_heading_settings', $args, 'avia_default_title_filter', array( $current_post ) ); $heading = ! empty( $args['heading'] ) ? $args['heading'] : $default_heading; $css = ! empty( $args['extra_class'] ) ? $args['extra_class'] : ''; $output = ""; $output .= "<{$heading} class='post-title entry-title {$css}' ".avia_markup_helper(array('context' => 'entry_title','echo'=>false)).">"; $output .= is_singular() ? $current_post['title'] : "<a href='".get_permalink()."' rel='bookmark' title='". __('Permanent Link:','avia_framework')." ".$current_post['title']."'>".$current_post['title']; $output .= "<span class='post-format-icon minor-meta'></span>"; $output .= is_singular() ? '' : '</a>'; $output .= "</{$heading}>"; $current_post['title'] = $output; } return $current_post; }
the links on the blog are still active – only the links on single-post are influenced.
btw: you can change on that line ( ternary operator ) :$default_heading = is_singular() ? 'h1' : 'h2';
if you like to have on single post (first tag) a h1 or whatever you like
h2 is only for blog-view (second tag in ternary operator)December 15, 2020 at 2:51 pm #1267484btw: the hover style is correlated with the title itself (not the anchor), so it remains valid.
if you do not like to have an opacity of 0.7 on hovering the heading:
this to quick css ( maybe an important is necessary ).html_elegant-blog #top .post-entry .post-title:hover, .html_elegant-blog .avia-content-slider .slide-entry-title:hover { opacity: 1; }
December 15, 2020 at 2:56 pm #1267485And dear Mods ( and Devs ) this might be the standard behavior. It makes no sense to have a link from a post to the post itself!
December 16, 2020 at 3:11 pm #1267844Perfect, thank you very much.
December 18, 2020 at 3:50 am #1268294Hi,
Thank you Guenni! Did you need additional help on this topic?
Best regards,
Jordan Shannon -
AuthorPosts
- You must be logged in to reply to this topic.