Tagged: Custom Post Type, title
Hello,
I want to change the title for a cpt but cant do it. Found help on the forum but didn’t wordk and ik do n’t know what I do wrong.
I udes this:
add_filter('avf_title_args', 'fix_single_post_title', 10, 2);
function fix_single_post_title($args,$id)
{
if ( is_singular('post') || is_singular('vervulde vacature') )
{
$args['title'] = get_the_title($id);
$args['link'] = get_permalink($id);
$args['heading'] = 'h1';
}
return $args;
}
Wkr,
Tim
Hi,
Thank you for sharing the details.
I’m assuming cpt = capitals?
Also did not mention which title you want to change so I’m assuming that to be the blog title?
Please remove your code and try adding this code to the Quick CSS section under Enfold > General Styling or to your child theme’s style.css file:
CSS Snippet:
/* CSS - */
body.single .post-title a {
text-transform: uppercase;
}
You may not see the changes until the cached files are cleared in your browser.
Please perform the below steps to clear the browser cache:
1. Disable “merging and compression” for CSS and JS files from Enfold > Performance.
2. If a caching plugin is installed check the plugin settings and clear the cache and deactivate the plugins for testing purpose.
3. Hard refresh by pressing Ctrl + Shift + F5 on your browser or press the F12 key to open chrome dev tools and right click on the refresh button and select “Empty Cache and Hard Reload”.
Best regards,
Vinay
Hello Vinay,
I ment Custom Post Type CPT :).
Hi,
For Post Types u need to check first:
if ( ‘book’ == get_post_type() ) and then the ID if you want ;-)
Best regards,
Basilis