Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 4 replies, 2 voices, and was last updated 10 years, 3 months ago by
Claude Dagenais.
-
AuthorPosts
-
05/10/2016 at 9:07 am #375832
Claude Dagenais
ParticipantHi,
Is it possible to create a filter to change the page title when I do a search in a category?
I would like to have instead of “category » page name” just the category displayed – I don’t use the page name anywhere in the site.
I can see that I can do the exact contrary and just display the page name in the SEO settings of connections and I see that all this is manage by the class.seo.php line 358 and following but I cannot figure how to filter it just to have the category in the title.
Here is an example (in French) http://staging.infosutton.com/bottin/?cn-cat=182
In this example we would like the title to be just “Activités” not “Activités » Bottin”
Tx05/10/2016 at 12:40 pm #375851Steven Zahm
Keymaster@ Claude
Presently there really is no way to do what you what … well, you could hook into the core WordPress
the_titlefilter just like Connections does but at a priority greater than 10 and then check for the Connections category and alter the title accordingly. So for instant gratification, you could do that.In version 8.5.15, I added the cn_page_title filter which you could hook into when it is released. The you can simply check the title pieces array for the category key and change the title accordingly.
Hope that helps!
05/10/2016 at 1:28 pm #375859Claude Dagenais
ParticipantThanks, 8.5.15 will be release soon I guess so I’ll wait for it. Could you give me an example how to filter with the new cn_page_title filter to achieve what I want?
tx05/10/2016 at 2:22 pm #375885Steven Zahm
Keymaster@ Claude
re: Could you give me an example how to filter with the new cn_page_title filter to achieve what I want?
add_filter( 'cn_page_title', 'cn_page_title_claude', 10, 5 ); function cn_page_title_claude( $title, $pieces, $separator, $original, $id ) { if ( isset( $pieces['term-category-name'] ) && ! empty( $pieces['term-category-name'] ) ) { $title = $pieces['term-category-name']; } return $title; }That should do it.
05/10/2016 at 2:29 pm #375887Claude Dagenais
ParticipantYou are the best sir. Thank you!
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
