Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #20487

    hello, the main tittle is not seo friendly

    for example on a shop category e.g. “printed tee shirts” the only h1 on the page is “shop” (or what ever your store page is)

    it doesn’t take the category tittle and put it in the main tittle. so your left with no h1s on the category page relevant to your shop.

    i’ve been trying to change this editing the replete functions file but cannot seem to work it out..

    Code:
    //advanced title + breadcrumb function
    if(!function_exists(‘avia_title’))
    {
    function avia_title($args = false, $id = false)
    {
    global $avia_config;

    if(!$id) $id = avia_get_the_id();

    $defaults = array(

    ‘title’ => get_the_title($id),
    ‘subtitle’ => “”, //avia_post_meta($id, ‘subtitle’),
    ‘link’ => get_permalink($id),
    ‘html’ => “<div class=’{class} title_container’><div class=’container’><h1 class=’main-title’>{title}</h1></div>{additions}</div>”,
    ‘class’ => ‘stretch_full container_wrap slideshow_color ‘.avia_is_dark_bg(‘slideshow_color’, true),
    ‘breadcrumb’ => true,
    ‘additions’ => “”

    );

    // Parse incomming $args into an array and merge it with $defaults
    $args = wp_parse_args( $args, $defaults );

    // OPTIONAL: Declare each item in $args as its own variable i.e. $type, $before.
    extract( $args, EXTR_SKIP );

    if(empty($title)) $class .= ” empty_title “;
    if(!empty($link)) $title = ““.$title.”“;
    if(!empty($subtitle)) $additions .= “<div class=’title_meta meta-color’>”.wpautop($subtitle).”</div>”;
    if($breadcrumb) $additions .= “<div class=’bc-container-wrap’><div class=’container bc-container’>”.avia_breadcrumbs().”</div></div>”;

    $html = str_replace(‘{class}’, $class, $html);
    $html = str_replace(‘{title}’, $title, $html);
    $html = str_replace(‘{additions}’, $additions, $html);

    if(!empty($avia_config['slide_output']) && !avia_is_dynamic_template($id) && !avia_is_overview())
    {
    $avia_config['small_title'] = $title;
    }
    else
    {
    return $html;
    }
    }
    }

    this is the area i’ve been working on but no luck, do you have a fix for this?

    #107845

    Open up wp-contentthemesrepleteconfig-woocommerceconfig.php and replace:

    if(!$title) $title  = __("Shop",'avia_framework');

    with:

    if(!$title) $title  = __("Shop",'avia_framework');

    if(is_product_category() || is_product_tag())
    {
    global $wp_query;
    $tax = $wp_query->get_queried_object();
    $title = $tax->name;
    $t_link = '';
    }

    #107846

    this is perfect thank you! top support!

    I also edited your code to

    Code:
    if(!$title) $title = __(“Shop”,’avia_framework’);

    if(is_product_category() || is_product_tag() || is_product())
    {
    global $wp_query;
    $tax = $wp_query->get_queried_object();
    $title = $tax->name;
    $t_link = ”;
    }

    (added is_product) taxonomy to try and replicate this for product pages it but it didnt work? is it the same process for product pages?

    #107847

    The is_product_category(), is_product_tag(), etc. functions are conditional tags: http://wcdocs.woothemes.com/codex/theming/conditional-tags/

    Imho it doesn’t make much sense to add the is_product() to the same if-statement. I’d rather use:

    if(is_product_category() || is_product_tag())
    {
    global $wp_query;
    $tax = $wp_query->get_queried_object();
    $title = $tax->name;
    $t_link = '';
    }
    else if( is_product() )
    {
    $title = get_the_title();
    $t_link = '';
    }

    #107848

    Thank you again, top support.

    was there any reason why you wouldn’t have mixed them together?

    #107849

    Hi!

    Yes, the product category pages and the tag pages require the wp_query var and it doesn’t make much sense to import/use it for single products.

    Best regards,

    Peter

    #107850

    Hi,

    I just updated my theme from version 1.3.x to 1.4.1. I had this code applied:

    if(is_product_category() || is_product_tag())

    {

    global $wp_query;

    $tax = $wp_query->get_queried_object();

    $title = $tax->name;

    $t_link = ”;

    }

    else if( is_product() )

    {

    $title = get_the_title();

    $t_link = ”;

    }

    I tried to make the same change in the file in version 1.4.1 and it seems to work on most pages, but on my product category pages, I’m seeing this:

    http://imageshack.us/a/img404/4420/errorpo.jpg

    I can confirm that this coding change causes the problem because it goes away if I remove these changes. Can you please help?

    #107851

    Hey!

    Version 1.4.1 already contains this fix and you don’t need to apply it manually.

    Best regards,

    Peter

    #107852

    Hey Dude, on the product pages, the main heading still seems to be “Shop” and not the title of the product. If I inspect though, both the main heading and the product title appear to be H1s. Aren’t you only supposed to have one H1 on every page for SEO?

    #107853

    Do you mean the single product pages? If yes you need to replace:

    if(is_product_category() || is_product_tag())
    {
    global $wp_query;
    $tax = $wp_query->get_queried_object();
    $title = $tax->name;
    $t_link = '';
    }

    with

    if(is_product_category() || is_product_tag())
    {
    global $wp_query;
    $tax = $wp_query->get_queried_object();
    $title = $tax->name;
    $t_link = '';
    }

    if(is_product())
    {
    $title = get_the_title();
    $t_link = '';
    }

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

The topic ‘main title seo unfriendly’ is closed to new replies.