Forums

The perfect title (2 posts)

  1. iGudi
    Member
    Posted 1 year ago #

    Hi everyone

    I want to use wordpress to display our products and I need to optimize our title so it includes the previous page title aswell. The previous page in my case has the "product group name" and this is a great deal regarding SEO.

    My site has the following structure:
    - mainpage
    - mainpage, products
    - mainpage, products, product group name
    - mainpage, products, product group name, product name

    Today my title on a product is like the following:
    product name - wp_title

    I need it to display the following:
    product group name - product name - wp_title

    The source i use today is the following:
    <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Arkiv <?php } ?> <?php wp_title(); ?></title>

    How will i go about optimizing my title?

    Looking forward to read your replys!

  2. iGudi
    Member
    Posted 1 year ago #

    Thanks to this page i have now made a working title.

    Could someone please validate this?

    <title><?php if($post->post_parent) { $parent_title = get_the_title($post->post_parent); echo $parent_title; echo ' · '; ?> <?php } ?><?php wp_title(''); ?><?php if(wp_title(' ', false)) { echo ' · '; } ?><?php bloginfo('name'); ?></title>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags