Home Forums WC Vendors Pro Support Bad Titles on Vendor Pages w/ Yoast SEO

NOTICE: We've Moved to a Ticket System for Support

As of August 31, 2017 (12am EST) our support forums will be retired (read-only), and we will be moving to a support ticket system.  This will allow us to better organize and answer support requests, and provide a more personalized experience as we assist our customers.

For the time being, we will leave our forums open for reading and learning while we work on creating a more robust Knowledge Base for everyone to use.

If you are a WC Vendors Pro customer please open a support ticket here. 

If you are a WC Vendors user please open a support ticket on the Wordpress.org forums.

The information on this forum is outdated and in most instances no longer relevant. Please be sure to check our documentation for the most up to date information.

https://docs.wcvendors.com/

Thank you to all of our customers!

 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #31880
    David R
    Participant

    With Yoast enabled, including the WooCommerce extension, my individual vendor’s pages have a title of “Products – My Site Name – My Site Name”. @alexstanhope, have you come across this problem?

    I’ve been working off of some gists in the KB, but I haven’t managed to crack this problem yet.

    #31881
    David R
    Participant

    Of course, I post this to get help, and 5 minutes later I have it resolved. Ugh.

    // No Yoast title for Vendor shop pages.
    add_filter('wpseo_title', 'wcv_wpseo_title');
    
    function wcv_wpseo_title($title) {
        $wpseo = WPSEO_Frontend::get_instance();
        $separator = $wpseo->options['separator'];
    
        $separator_options = array(
            'sc-dash' => '-',
            'sc-ndash' => '–',
            'sc-mdash' => '—',
            'sc-middot' => '·',
            'sc-bull' => '•',
            'sc-star' => '*',
            'sc-smstar' => '⋆',
            'sc-pipe' => '|',
            'sc-tilde' => '~',
            'sc-laquo' => '«',
            'sc-raquo' => '»',
            'sc-lt' => '<',
            'sc-gt' => '>',
        );
    
        if (array_key_exists($separator, $separator_options)) {
            $separator = $separator_options[$separator];
        }
    
        if (WCV_Vendors::is_vendor_page()) {
            $vendor_shop 		= urldecode( get_query_var( 'vendor_shop' ) );
            $vendor_id   		= WCV_Vendors::get_vendor_id( $vendor_shop ); 
            $shop_name 			=  get_user_meta( $vendor_id, 'pv_shop_name', true );
            $title = $shop_name;
        }
    
        return $title . ' ' . $separator . ' ' . get_bloginfo();
    }
    #31884
    WC Vendors Support
    Participant

    That code might work too, but just looks like a lot of work. Either way will do the trick. 🙂

    #31885
    David R
    Participant

    Haha. Well, that’s easier. I tried a dozen things, and nothing was coming close to working. I should have posted here 24 hours ago.

    Thanks, Ben.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘WC Vendors Pro Support’ is closed to new topics and replies.