I try to change title on Archive page because i use it to list custom article type. In fact, i want to remove "Archive " text at the start of page title.
I use wordpress 5.8 and a custom theme from twenty twenty.
In my header.php file, there is that :
<?php wp_head(); ?>
But when i write the code below into my functions.php
, nothing happens.
remove_action('wp_head', '_wp_render_title_tag');
I have also try to use filter but i don’t use it properly because nothing happens too.
How can i do that ?
Thanks !
3
Answers
Thanks @HowardE & @DeanTwit but i think my template have a problem beacause when i write :
echo "i am here"
into the functions, nothing happens.I have write your code at the end of functions.php.
Is there a manipulation to be performed to run this process ?
This one should do the trick :
Add it to your child theme -> functions.php
Edit: It replace the page title with empty string.
To change the Archive Title, there are a few ways. One is probably using an SEO plugin? But to do it programmatically, you can use the filter
get_the_archive_title
Change
your_taxonomy
to the name of the taxonomy you want to modify what is displayed.