Questions titles not working
Did you installed Yoast ? if yes then you have to update or if you dont want to update to unstable version then add this hooks in
includes/class-theme.php
add this inside __construct method:
add_filter('wpseo_title', array( $this, 'wpseo_title' ) , 10, 2);
And now add this method to class:
public function wpseo_title($title){ if (is_anspress()) { remove_filter('wpseo_title', array($this,'wpseo_title')); $new_title = ap_page_title(); if(strpos($title, 'ANSPRESS_TITLE') !== false) $new_title = str_replace('ANSPRESS_TITLE', $new_title, $title). ' | ' . get_bloginfo( 'name' ); else $new_title = $new_title.' | '. get_bloginfo( 'name' ); $new_title = apply_filters('ap_wpseo_title', $new_title); return $new_title; } return $title; }
Rahul Aryan commented
Will check.
Vishes_UA commented
Tell me where to make these changes?
“includes / class-theme.php” – it “anspress” folder or in a folder with the theme of your site?
“public function wpseo_title ($ title)” – and this is where?
Rahul Aryan commented
Please have a look at github repository. I directly copied it from includes/class-theme.php
Vishes_UA commented
Good! I replaced the file and it worked! Thanks! )
Just uploaded the unstabled version and that fixed the problem however it turns out like this now: Sample question for north america | Backpacker Travel | Backpacker Travel (the last part doubles up)