Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #18974

    By modifying the permanent link, we were able to replace the static SHOP word with permalink title,

    the problem is the category page title is changing to its title

    ‘mytitle’ => get_the_title($ID),

    I would like to know how to do this or what function or what file is controlling the category page of the product

    I was thinking of doing a conditional statement but I believe there is an easier way to implement this

    thanks in advance

    #101549

    If you want to change the page title of an archive/category page you need to change the $defaults option array in functions-replete.php. I’d use conditional statements: http://wcdocs.woothemes.com/codex/theming/conditional-tags/ / http://codex.wordpress.org/Conditional_Tags to change it. You can use it like:

    $defaults 	 = array(

    'title' => get_the_title($id),
    'subtitle' => "", //avia_post_meta($id, 'subtitle'),
    'link' => get_permalink($id),
    'html' => "<div class='{class} title_container'></span><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' => ""

    );

    if(is_product_category()) $defaults['title'] = 'my category title';

    #101550

    By doing it directly

    <div class=’{class} title_container’></span><div class=’container’><h1 class=’main-title’>{title}<?php echo get_the_title($ID); ?> </h1></div>{additions}</div>”,

    I get the title but not the category title

    http://www.celebritysuitshop.com/product-category/type/2-piece-suit/ where title should be category title ,

    for single post it work fine

    http://www.celebritysuitshop.com/shop/brad-pitt-grey-2-piece-suit-from-inglorious-basterds-premier/

    using {title} return no value or blank

    #101551

    You should be able to retrieve the term title with the single_term_title() function: http://codex.wordpress.org/Function_Reference/single_term_title

    Try following code:

    $defaults 	 = array(

    'title' => get_the_title($id),
    'subtitle' => "", //avia_post_meta($id, 'subtitle'),
    'link' => get_permalink($id),
    'html' => "<div class='{class} title_container'></span><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' => ""

    );

    if(is_product_category()) $defaults['title'] = single_term_title('', false);

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

The topic ‘Permalink Shop Title To Category/Product Title’ is closed to new replies.