-
AuthorPosts
-
July 18, 2013 at 3:32 pm #26405
Hi,
I was wondering if it were possible to change the heading listing from “Posts” to “Articles” in the header search form results. So instead of Posts & Pages results it would return Articles & Pages results.
Thanks for your help
July 19, 2013 at 2:15 am #130299Hi,
I can’t seem to find the actual “Post & Pages” text on the search results. Can you give us a screenshot?
Regards,
Ismael
July 19, 2013 at 5:10 pm #130300July 20, 2013 at 6:25 am #130301Hi,
Open functions-enfold.php, find this code
//now we got everything we need to preapre the output
foreach($sorted as $key => $post_type)
{
if(isset($post_type_obj[$key]->labels->name))
{
$output .= "<h4>".$post_type_obj[$key]->labels->name."</h4>";
}
else
{
$output .= "<hr />";
}Replace it with:
//now we got everything we need to preapre the output
foreach($sorted as $key => $post_type)
{
if(isset($post_type_obj[post]->labels->name))
{
$output .= "<h4>Articles</h4>";
}
elseif(isset($post_type_obj[page]->labels->name))
{
$output .= "<h4>Pages</h4>";
}
elseif(isset($post_type_obj[$key]->labels->name))
{
$output .= "<h4>".$post_type_obj[$key]->labels->name."</h4>";
}Regards,
Ismael
July 22, 2013 at 3:09 pm #130302Hi Ismael,
I tried the code mentioned above and now it’s repeating both areas as Articles. Any ideas?
July 23, 2013 at 4:43 am #130303Hey,
Sorry for that. Try this instead.
foreach($sorted as $key => $post_type)
{
if(isset($post_type_obj[post]->labels->name))
{
$output .= "<h4>Articles</h4>";
} elseif(isset($post_type_obj[$key]->labels->name))
{
$output .= "<h4>".$post_type_obj[$key]->labels->name."</h4>";
} else {
$output .= "<hr />";
}Regards,
Ismael
July 29, 2013 at 7:19 pm #130304Hi Ismael – Still having the same results :(
July 30, 2013 at 6:37 am #130305Hi,
Please remove browser cache the reload the page. The code works fine on my end. :)
foreach($sorted as $key => $post_type)
{
if(isset($post_type_obj[post]->labels->name))
{
$output .= "<h4>Articles</h4>";
} elseif(isset($post_type_obj[$key]->labels->name))
{
$output .= "<h4>".$post_type_obj[$key]->labels->name."</h4>";
} else {
$output .= "<hr />";
}Please give us a link to your website.
Cheers,
Ismael
July 30, 2013 at 2:08 pm #130306I must be doing something wrong. Here is what I have…
Code://now we got everything we need to preapre the output
foreach($sorted as $key => $post_type)
{
if(isset($post_type_obj[post]->labels->name))
{
$output .= “<h4>Articles</h4>”;
}
elseif(isset($post_type_obj[$key]->labels->name))
{
$output .= “<h4>”.$post_type_obj[$key]->labels->name.”</h4>”;
}
else {
$output .= “
“;
}I’ve cleared browser cache, tried other browsers and have even purged CDN cache, object cache and page-cache (I use WP Engine) and it still looks like this…
July 31, 2013 at 3:29 am #130307August 1, 2013 at 5:28 pm #130308Yes it is a page
August 1, 2013 at 5:34 pm #130309Hey!
See https://kriesi.at/support/topic/search-drop-down-titles – probably the thread answers your question too.
Best regards,
Peter
August 6, 2013 at 2:35 pm #130310Thanks so much Dude, that did the trick!
Ismael, I also really appreciate your help on this too!
-
AuthorPosts
- The topic ‘AJAX Search Results’ is closed to new replies.