Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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/w1gl3l

    Need to leave h1 only, without the inner tag wrapping the title.

    Thank you.

    #1267022

    Hey sammilo4,

    Do you need it to just not be clickable?

    Best regards,
    Jordan Shannon

    #1267480
    #1267481

    see 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)

    #1267484

    btw: 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;
    }
    #1267485

    And 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!

    #1267844

    Perfect, thank you very much.

    #1268294

    Hi,

    Thank you Guenni! Did you need additional help on this topic?

    Best regards,
    Jordan Shannon

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