Wrong title displayed if using query posts widgets

General questions pertaining to how certain issues can be resolved
Forum rules
1. No offensive language and no mocking
2. Please do a thorough search before you post something. Trust us, there is a high probability that the question you are asking has been asked previously.
3. No soliciting. You cannot post here soliciting bids for people offer you quotes, or even offer money to people for some work. You will be moderated if you do so. If you are looking for help, please post your request on http://jobs.wordpress.net or http://codepoet.com
4. Please be reasonable. You are getting software and support. For free. Complicated requests from a general purpose theme are not welcome and some volunteers might lose patience with you.
5. Please do your due diligence. If you posted a query and we answered with a link, take the trouble to go through the link contents.
6. Please post with complete information. Requests for help MUST be accompanied with your URL, particularly if you are asking something like "Why am I seeing a blank space?"

Wrong title displayed if using query posts widgets

Postby newbie2012 » 27 Mar 2012, 20:00

Hello.

I would really appreciate some help.

I am using Wordpress SEO by Yoast and I've noticed that when I add a query post on my website, the title displayed on my browser is always the title of the last post in the query post widget.

I've found on the web that the way to solve this is to make sure that the call to wp_head or wp_title (not sure which one) has to come before the call to query_posts.

I'm not familiar with coding and was wondering how I could achieve this with a child theme?

FYI:
1. I did not add <title><?php wp_title(''); ?></title> to my header.php but just checked the box to Force rewrite titles in the Wordpress SEO plugin
2. The two widgets on the right ("Top Stories" and "Other Stories") are query posts widgets

Example of wrong title being displayed on browser title: http://www.flirtingsms.org/michael-fior ... hip-expert

Thanks in advance for the help.

P.S. Would doing this cause any possible problems?
newbie2012
 
Posts: 7
Joined: 24 Feb 2012, 19:21

[Solved] Wrong title displayed if using query posts widgets

Postby newbie2012 » 16 Apr 2012, 08:04

Thanks to Sayontan for the solution (although I think it's now already added in the latest releases). If not,

Sayontan Sinha wrote:

In the suffusion-query-posts.php file, around line 182 you will see this:

Code: Select all
$ret .= "</ul>";

Just before this line add:

Code: Select all
wp_reset_query();
newbie2012
 
Posts: 7
Joined: 24 Feb 2012, 19:21


Return to Support Requests

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], GregoryGoth and 8 guests

cron