Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #349969

    Hi team,

    in Coherence there are many H1 tags (Logo, Slideshow, Portfolio Items, etc). Please post a guidance how to remove/change them into div or h2/h3, etc

    I have read the following post but was not able to fix it:
    https://kriesi.at/support/topic/ (Purchase code hidden if logged out) -seo/

    Rgds

    #350285

    Hi netfex!

    For the slideshow try line 202 in /coherence/includes/helper-slideshow.php.

    if(!empty($slide['slideshow_caption_title'])) $data .= '<h1 '.$font_style.'>'.$slide['slideshow_caption_title'].'</h1>';
    

    For the portfolio try line 393 in /coherence/functions-coherence.php.

    $output .= '<h1 class="main-title">'.$title.'</h1>';
    

    For the logo try line 1294 in /coherence/framework/php/class-htmlhelper.php

    <h2 class="avia_logo">'.$the_title.' '.$this->avia_superobject->currentpage.'</h2>';
    

    Regards,
    Elliott

    #353777

    Great – worked.
    But changing the h1 to h2 in “functions-coherence.php” in line 393 caused a change of all h1 tags on sub-pages

    I know its a different topic, but could you give advice on the same issue for the theme “Enfold”? Have the same issues on our own website

    Thanks!

    #353969

    Hi!

    Enfold shouldn’t be doing that. Send us a link to your page and we’ll take a look. You can mark your reply as private if you wish.

    Best regards,
    Elliott

    #431223
    This reply has been marked as private.
    #431803

    Hey!

    Use this in the functions.php file:

    add_action('wp_footer', 'ava_custom_script');
    function ava_custom_script(){
    ?>
    <script>
    (function($){
        $('.portfolio-title').each(function() {
    		$(this).find('h1').replaceWith(function() {
    				return '<h2>' + $(this).text() + '</h2>';
    		});
    	});
    })(jQuery);
    </script>
    <?php
    }

    Best regards,
    Ismael

    #431885
    This reply has been marked as private.
    #432561

    Hey!

    Replace the code with this:

    add_action('wp_footer', 'ava_custom_script');
    function ava_custom_script(){
    ?>
    <script>
    (function($){
        $('.portfolio-title, .portfolio-entry.one_third div').each(function() {
    		$(this).find('h1').replaceWith(function() {
    				return '<h2>' + $(this).text() + '</h2>';
    		});
    	});
    })(jQuery);
    </script>
    <?php
    }

    Best regards,
    Ismael

    #432644
    This reply has been marked as private.
    #432879

    Hey!

    Please change the code to following one

    add_action('wp_footer', 'ava_custom_script');
    function ava_custom_script(){
    ?>
    <script>
    (function($){
        $('.portfolio-title, .portfolio-entry.one_third div,.portfolio-entry .main-title').each(function() {
    		$(this).find('h1').replaceWith(function() {
    				return '<h2>' + $(this).text() + '</h2>';
    		});
    	});
    })(jQuery);
    </script>
    <?php
    }

    Best regards,
    Yigit

    #433421
    This reply has been marked as private.
    #433935

    Hey!

    Ok. Replace the code with this:

    add_action('wp_footer', 'ava_custom_script');
    function ava_custom_script(){
    ?>
    <script>
    (function($){
        $('.portfolio-title').each(function() {
    		$(this).find('h1').replaceWith(function() {
    				return '<h2>' + $(this).text() + '</h2>';
    		});
    	});
    })(jQuery);
    </script>
    <?php
    }

    Edit functions-enfold.php file, look for this code around line 67:

    echo avia_title($id, false, "");
    

    Replace it with:

    echo "<div class='title_container'><h2 class='main-title'>".get_the_title($id)."</h2></div>";
    

    Best regards,
    Ismael

    #433987
    This reply has been marked as private.
    #434002
    This reply has been marked as private.
    #434946

    Hi!

    I checked the site but I don’t see any h1 tags anymore. Please remove browser cache then reload the page. If you can still see any h1 tags, please provide a screenshot.

    Best regards,
    Ismael

    #515317

    Hi Ismael, sorry to open this old topic again. But I am still getting H1 tags when viewing the source code of the homepage. See the screenshots attached for explanation:

    http://www.sic-design.de/wp-content/themes/coherence/sic_h1_1.jpg
    1) by checking the HTML elements in Chrome I can see that its marked as h3

    http://www.sic-design.de/wp-content/themes/coherence/sic_h1_2.jpg
    2) but when viewing the whole source code of the page it says that its a completely different output (with h1, permalink, etc)

    empty the cache, etc didnt resolve the problem. Could you please digg into it and provide a solution?

    #515727

    Hey!

    can you provide us precise links to the sites in question please? because we need to inspect the elements. We need admin access as well. Post login details here as private reply.

    Regards,
    Andy

    #515836

    Hi Andy,

    the link is the homepage of the site: http://www.sic-design.de
    What kind of access do you need? Login details to WordPress provided in the private content

    Regards
    Thomas

    #516166

    Hi!

    Thank you for the update. Please remove the modifications we provided above then add this in the functions.php file:

    	function avia_title($title = false, $subtitle = false, $class = false, $link = false, $heading = "h1")
    	{
    		$output	= "";
    		$id = avia_get_the_id();
    		if(is_numeric($title))
    		{
    			$id = $title;
    			$title = false;
    		}
    		
    		if($title === false) $title = get_the_title($id);
    		if($subtitle  === false) $subtitle = avia_post_meta($id, 'subtitle');
    		if($class === false) $class = 'stretch_full';
    		if($link)
    		{
    			if($link === true) $link = get_permalink();
    			$title = "<a href='".$link."' rel='bookmark' title='".__('Permanent Link:','avia_framework')." ".$title."'>".$title."</a>";
    		} 
    		
    		$output .= "<div class='$class title_container'>";
    			$output .= "<{$heading} class='main-title'>{$title}</{$heading}>";
    		
    			if($subtitle)
    			{
    				$output .= "<div class='title_meta meta-color'>";
    				$output .= wpautop($subtitle);
    				$output .= "</div>";
    			}
    		$output .= "</div>";
    		
    		return $output;
    	}

    After that, modify the includes > loop-portfolio.php file, look for this code on line 134:

    echo avia_title($the_id, false, "portfolio-title", $link = true);
    

    .. replace it with:

    echo avia_title($the_id, false, "portfolio-title", $link = true, "h3");
    

    Regards,
    Ismael

    #516348

    Hi Ismael

    thanks for the solution. Works well.
    Will be great if you can include this in upcoming updates of Coherence.

    Regards
    Thomas

    #517100

    Hi,

    Great, glad we could help and thanks for the feedback.

    Thanks,
    Rikard

Viewing 21 posts - 1 through 21 (of 21 total)

The topic ‘Coherence – remove H1 tags’ is closed to new replies.