Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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

    #130299

    Hi,

    I can’t seem to find the actual “Post & Pages” text on the search results. Can you give us a screenshot?

    Regards,

    Ismael

    #130300
    #130301

    Hi,

    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

    #130302

    Hi Ismael,

    I tried the code mentioned above and now it’s repeating both areas as Articles. Any ideas?

    #130303

    Hey,

    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

    #130304

    Hi Ismael – Still having the same results :(

    #130305

    Hi,

    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

    #130306

    I 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…

    https://www.dropbox.com/s/vwqy2unx9dg2o7o/screen.png

    #130307

    Hi,

    What is the Wellness Resources? Is it a page?

    Regards,

    Ismael

    #130308

    Yes it is a page

    #130309

    Hey!

    See https://kriesi.at/support/topic/search-drop-down-titles – probably the thread answers your question too.

    Best regards,

    Peter

    #130310

    Thanks so much Dude, that did the trick!

    Ismael, I also really appreciate your help on this too!

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘AJAX Search Results’ is closed to new replies.