Page Title changing to "undefined" when using AJAX links
-
Hi there. I am running a custom theme based on the Bootstrap development framework. Here is the code I am using in my theme’s header.php file to set the page title:
<title> <? wp_title( '|', true, 'right' ); ?> <? bloginfo('blogtitle'); ?> <? $site_description = get_bloginfo( 'description', 'display' ); if ( is_front_page() ) { echo ' | '.$site_description; } ?> </title>
This plugin is working perfectly for me except for one thing. When using any links that load content with AJAX, the page title is getting set to ‘undefined’.
So for example, if I load
https://www.mysite.com/events
the page title is set to
Upcoming Events | My SiteIf I click on the navigation links at the bottom, the page title changes to
undefinedIf I reload that page
https://www.mysite.com/events/past
the page title is set to
Past Events | My SiteIf I click on the title of an Event from any of the lists, the page title is
Name of Event | My Sitebut if I click the Back button to return to the list, again the page title gets set to
undefinedI have tested this on a different install using the default WP theme and this issue doesn’t happen in that case. My question is, could it be possible for the Bootstrap jQuery code to be interfering with this plugin in some way? If there are other known plugin conflicts, could someone point me in the right direction to see if I am running any of those plugins? Any suggestions at all for where the bug in my theme could be?
- The topic ‘Page Title changing to "undefined" when using AJAX links’ is closed to new replies.