- This topic has 30 replies, 6 voices, and was last updated 6 years ago by Tom.
-
AuthorPosts
-
September 12, 2016 at 6:24 am #225783celito
Hi, I’m sorry to bother you again. I had Word Press re-installed and re-installed the GP theme, GP premium and all other plugins. I again retraced the steps in this previous thread to change the Archives title. While I got it in the first attempt the last time, I can’t get it to work this time. When I update the plugin created with Pluginception attaching the php script from github, this error message pops up:
Oops! That page canβt be found.
It looks like nothing was found at this location. Maybe try searching?The script can’t be saved. I tried Simple PHP but same result. What am I doing wrong? Thanks.
Celito
September 12, 2016 at 7:26 am #225809LyleThought that I would jump in to say that another way to change any string in a theme, plugin or even WordPress core is to use the Loco Translate plugin. If you save the generated .po, .mo and .pot files to the /languages folder and not the /loco folder, you can deactivate and delete the plugin when you are finished and your changes will remain intact. I have used this on a couple sites and it is really quite slick and does not require getting one’s “hands dirty” with PHP π
https://wordpress.org/plugins/loco-translate/
Cheers!
LyleSeptember 12, 2016 at 8:54 am #225843TomLead DeveloperLead DeveloperAnother option is this plugin: https://en-ca.wordpress.org/plugins/say-what/
It sounds like you have something weird going on with your installation, as saving a file shouldn’t cause a 404 error. Have you checked with your hosting support?
September 12, 2016 at 9:44 am #225855celitoThanks. I’ll check out this plugin and also refer this issue to the hosting site.
Celito
September 12, 2016 at 9:46 am #225857celitoThanks Lyle. I’ll also try this out.
September 13, 2016 at 3:27 am #226030n52Hi
Tom, may you write what I have to do step by step to change Title?. please…You need to alter the function to include the conditional for your custom post type and your custom title.
September 14, 2016 at 1:55 pm #226468n52Hurah… I solved it π
page-header and page-title are different things πSeptember 14, 2016 at 1:57 pm #226473TomLead DeveloperLead DeveloperAwesome! Great job π
March 12, 2017 at 8:26 am #290385njwrigleyThis served me well. For the case above you can use this:
elseif ( is_post_type_archive( 'your_custom_post_type_slug' ) ) : _e( 'your_new_archive_title', 'generatepress' );
March 12, 2017 at 9:12 am #290397TomLead DeveloperLead DeveloperThanks for sharing! π
April 5, 2018 at 8:19 am #542044ThierryHello,
And for displaying only the title fron a CPT, no change “archives” but without “archives” ?
Thx
April 5, 2018 at 10:05 pm #542610TomLead DeveloperLead DeveloperI’m not too sure what you mean? You don’t want “Archives” to show in the title while viewing CPT archives? Can you link me to the page?
April 6, 2018 at 1:17 am #542707ThierryThat’s right : hide “archives”, i haven’t a link, its just on local
April 6, 2018 at 9:38 am #543101TomLead DeveloperLead DeveloperYou could try this:
add_filter( 'get_the_archive_title', 'tu_adjust_cpt_archives_title' ); function tu_adjust_cpt_archives_title( $title ) { if ( is_post_type_archive() ) { $title = post_type_archive_title( '', false ); } return $title; }
April 7, 2018 at 12:17 am #543519ThierryGreat Tom, thx
-
AuthorPosts
- You must be logged in to reply to this topic.