WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
[resolved] HTML title for Shopp front page incorrect (5 posts)

  1. joshlutton
    Member
    Posted 1 year ago #

    Hi, I seem to be having a problem with WordPress SEO and Shopp. I'm using WP 3.4.2, WP SEO 1.2.8.4, and Shopp 1.2.3.

    I use WP SEO to manage my html titles. This works fine on my posts, pages, and Shopp product pages. It creates a title in format "Page" | Woodlawn Associates. (Where "Page" is the actual name of the page, without quotes.) See http://www.woodlawnassociates.com for an example.

    However, on the Shopp landing page (http://www.woodlawnassociates.com/store) the title is incorrect ("- Woodlawn Associates"). I can't seem to find anywhere in WP SEO that I should be changing, and Shopp's advice was basically to turn off WP SEO's title-rewriting function, which I don't want to do because I'm otherwise quite happy with it.

    Can anyone suggest what I'm doing wrong, if there is something I should be configuring differently in WP SEO, or if there is some minor code tweak I could make? I'm comfortable hacking a small bit of code but I am by no means an PHP developer.

    http://wordpress.org/extend/plugins/wordpress-seo/

  2. ovolatier
    Member
    Posted 1 year ago #

    I have exaclty the same problem, but for me title in the store is :
    %%title%% | Panier des Sens
    http://www.panierdessens.us/store/

    So this is worse,

    I let you know if I find a solution

    Thanks
    Olivier

  3. Adam Dunford
    Member
    Posted 1 year ago #

    i had the same problem as ovolatier, and I ended up adding a filter to my functions.php file, as follows:

    function wpseo_title_exclude($wp_title) {
        if (is_catalog_frontpage()) {
    		$wp_title = get_the_title().' | '.get_bloginfo('name');
    		return $wp_title;
        }
    	else return $wp_title;
    }
    
    add_filter('wpseo_title','wpseo_title_exclude');

    That $wp_title line get's the title of the current page (in this case, the name I gave the shop for the page title and base slug for products, categories & collections (Shopp Setup -> Pages)) and then appends the name I gave my site as a whole.

    Hope that helps!

  4. joshlutton
    Member
    Posted 1 year ago #

    Adam,

    Thanks very much for your post. Your code allowed me to get our site working correctly, too. I made one modification, which was to replace the "is_catalog_frontpage ()" function with "is_shopp_page ()". Doing this fixed not only the store front page, but also other shopp pages like the cart, checkout, etc.

    Here is the exact code I added to the function.php file in my child theme:

    <?php
    
    /*
     * Function and filter to fix Shopp page titles when using WordPress SEO
     *
     */
    
    function wpseo_title_exclude($wp_title) {
        if (is_shopp_page()) {
    		$wp_title = get_the_title().' | '.get_bloginfo('name');
    		return $wp_title;
        }
    	else return $wp_title;
    }
    
    add_filter('wpseo_title','wpseo_title_exclude');
    
    ?>
  5. trendyweb
    Member
    Posted 1 year ago #

    Thanks guys, this solution worked for me too!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic