Change title

This topic contains 25 replies, has 4 voices, and was last updated by  Giri 7 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #365083

    Giri
    Expired Member
    Post count: 3155
    
    
    .post-type-archive h1.page-title {
        margin-top: 30px;
    }
    #365104

    Jonny S
    Expired Member
    Post count: 83

    1 more thing – when I go into my events tab the title of the page should be “Events” but for some reason it’s showing the title of the last event I have added. For example if you go to http://cluster10857.extendcp.uk/test-trailscotland.co.uk/events/ it shows the title as “The Eliminator” when it should just show Events.

    #365109

    Giri
    Expired Member
    Post count: 3155

    We had that problem earlier.

    Refer this thread.

    https://wpgeodirectory.com/support/topic/listing-page-h1/#post-306035

    Thanks

    #365142

    Jonny S
    Expired Member
    Post count: 83

    Thanks for the css. Where do I paste this code you provided earlier? define(‘CODE_SNIPPETS_SAFE_MODE’, true);

    #365144

    Giri
    Expired Member
    Post count: 3155

    You don’t need that.

    That was needed only if you can’t able to access wp-admin because of code snippets

    #365146

    Jonny S
    Expired Member
    Post count: 83

    So you want me to copy this into my functions.php file

    function kleo_title()
    {
    $output = “”;

    if ( is_category() )
    {
    $output = __(”,’kleo_framework’).” “.single_cat_title(”,false);
    }
    elseif (is_day())
    {
    $output = __(‘Archive for date:’,’kleo_framework’).” “.get_the_time(‘F jS, Y’);
    }
    elseif (is_month())
    {
    $output = __(‘Archive for month:’,’kleo_framework’).” “.get_the_time(‘F, Y’);
    }
    elseif (is_year())
    {
    $output = __(‘Archive for year:’,’kleo_framework’).” “.get_the_time(‘Y’);
    }
    elseif (is_search())
    {
    global $wp_query;
    if(!empty($wp_query->found_posts))
    {
    if($wp_query->found_posts > 1)
    {
    $output = $wp_query->found_posts .” “. __(‘search results for:’,’kleo_framework’).” “.esc_attr( get_search_query() );
    }
    else
    {
    $output = $wp_query->found_posts .” “. __(‘search result for:’,’kleo_framework’).” “.esc_attr( get_search_query() );
    }
    }
    else
    {
    if(!empty($_GET[‘s’]))
    {
    $output = __(‘Search results for:’,’kleo_framework’).” “.esc_attr( get_search_query() );
    }
    else
    {
    $output = __(‘To search the site please enter a valid term’,’kleo_framework’);
    }
    }

    }
    elseif (is_author())
    {
    $curauth = (get_query_var(‘author_name’)) ? get_user_by(‘slug’, get_query_var(‘author_name’)) : get_userdata(get_query_var(‘author’));
    $output = __(‘Author Archive’,’kleo_framework’).” “;

    if(isset($curauth->nickname)) $output .= __(‘for:’,’kleo_framework’).” “.$curauth->nickname;

    }
    elseif (is_tag())
    {
    $output = __(‘Tag Archive for:’,’kleo_framework’).” “.single_tag_title(”,false);
    }
    elseif(is_tax())
    {
    $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) );
    $output = __(”,’kleo_framework’).” “.$term->name;

    } elseif ( is_front_page() && !is_home() ) {
    $output = get_the_title(get_option(‘page_on_front’));

    } elseif ( is_home() && !is_front_page() ) {
    $output = get_the_title(get_option(‘page_for_posts’));

    } elseif ( is_404() ) {
    $output = __(‘Error 404 – Page not found’,’kleo_framework’);
    }
    else {
    if (geodir_is_page(‘listing’)) {
    ob_start(); // Start buffering;
    geodir_action_listings_title();
    $title = ob_get_contents();
    ob_end_clean();
    $output = $title;
    } elseif (geodir_is_page(‘author’)) {
    ob_start(); // Start buffering;
    geodir_action_author_page_title();
    $title = ob_get_contents();
    ob_end_clean();
    $output = $title;
    } else {
    $output = get_the_title();
    }
    }

    if (isset($_GET[‘paged’]) && !empty($_GET[‘paged’]))
    {
    $output .= ” (“.__(‘Page’,’kleo_framework’).” “.$_GET[‘paged’].”)”;
    }

    return $output;
    }

    #365147

    Giri
    Expired Member
    Post count: 3155

    Yes, But make sure to copy properly. If the quotes are converted like you posted above then you are gonna have bad time

    #365166

    Jonny S
    Expired Member
    Post count: 83

    This may sound a bit stupid but what do you mean when you say I need to by copy it properly? Do I not just highlight it all then right click and press copy? I tried doing that and it resulted in the error I posted earlier. Are you able to do this for me? Thanks

    #365167

    Giri
    Expired Member
    Post count: 3155

    Done

    #365207

    Jonny S
    Expired Member
    Post count: 83

    Thanks Giri, appreciated!

    #365582

    Giri
    Expired Member
    Post count: 3155

    You are welcome Jonny.

Viewing 11 posts - 16 through 26 (of 26 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket