Thanks Shane, I added this as a Custom Code and activated it. However, I don't understand where and how I then can change the Page Title for that category page?
This controls anything that is displayed before "Larmbolag - " Unless you are referring to my screenshot which is something completely different that the title on the page itself. In this case you can use the YOAST SEO plugin and go to Yoast -> Search Appearance and select taxonomy, from there you can modify the taxonomy title tag.
If its the title on the page itself you can add any text to the section where you see i've added the text "Test". This will appear before "Katalog över säkerhetsföretag".
I am referring to the screenshot. I use Yoast but I can't change the individual page title for that page /larmbolag/ I can set a template for the posts within that category but not the category page itself.
The only other way to individually set the title based on the current category is to use the code below.
function generate_custom_title($title) {
/* your code to generate the new title and assign the $title var to it... */
if( is_category('Uncategorized') ) {
$title = "cust title 1";
}
if(is_category('Sample')){
$title = "Cust title 2";
}
return $title;
}
add_filter( 'pre_get_document_title', 'generate_custom_title', 10 );
Please note that you will need to set the titles individually for each category. Secondly you will replace 'Sample' and 'Uncategorized' with the slug of the category that you want to change the title for.
When adding this code ensure that after its added to the Toolset custom code section that you've activated it.