For a new project, I am using the Centric Pro child theme from StudioPress. In that child theme, the page title is displayed at the top, like so:
By default, Centric Pro uses the page title for this text. Personally, I prefer to name pages something simple (i.e. Contact, About, etc.) and, for SEO purposes, change the title using the WordPress SEO plugin by Yoast. However, for this project using Centric Pro, I wanted to change the title being used for display at the tops of pages. Preferably, this would be a custom field I set for each page. This concept can be used for any child theme but here is what I did specifically for Centric Pro.
Create a Custom Field for Your Header Title
For this, I installed and activated the Advanced Custom Fields plugin. Then, I created a field group and added a Text field named rv_page_title. This field is set to display only on pages and I will use it for setting a title to display at the top.
Edit the Functions.php
Next, we need to edit some code in the functions.php. If you are using Centric Pro, you will find a block of that looks like this:
What I did was filter the post title text, using the Genesis filter genesis_post_title_text, to replace the text with the value of my rv_page_title custom field. Additionally, I added some code to remove the page title from the front page.
If you are not using Centric Pro but would like to do something similar with your child theme’s page titles, here are the other functions you’ll need to add: centric_open_post_title() and centric_close_post_title(). Just remember to add your CSS.
Wrapping Up
There you go! You’re now ready to set your own custom page titles to display at the top of your pages using the Genesis Framework. If you have a question, post it in the comments. Thanks for reading!
Minh Tu says
Hi Ren,
I want to change genesis seo title, genesis seo description by do shortcode, but my code not working on pharse.
I using code: add_filter(‘genesis_seo_title’,’do_shortcode’);
Pls give me some advice, thanks!
Jamie Mitchell says
thanks for the tut, great idea with the custom field.
A lot of folks want to be able to have a blog title on the blog page and single post pages which centric does not, just a title like “Latest News” that people can easily edit without having to go in the functions.php
what would be ideal is having an option in genesis > theme settings, with a box to add their chosen title to appear on the blog page and single post pages.
any ideas how to do this?
Ren says
Hi, Jamie. Putting something like this into a plugin wouldn’t be too difficult. You could register some settings within Genesis to output the desired content and then style it to be compatible with your theme.
Josephine says
Hi, this is an interesting post! Could I use this also to get a blog page title to display? Because in Centric Pro there is no blog page title at all…
Cheers,
Josephine
Ren says
Sure, you can modify this to use on any post (Posts, Pages, CPTs). It should work for single Posts if you just add is_singular( ‘post’ ) to the first if statement, making it look like this:
You’ll also need to enable the custom field to display when editing Posts (if you’re using ACF) to make sure that there’s data for the code to pull.