This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Inserting shortcode into search.php

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Inserting shortcode into search.php

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11564
    thorntonp72thorntonp72
    Participant

    Hi,

    Since I cannot modify the menu bear, my theme has a search icon, for which the results are very basic, but I am wokring on that. What I am trying to do is somehow, include the ajax pro search into the results page. I thought I would try the line below, but I do not get any results. Can you suggest a better way as the search results page has no template to modify.

    <div class=’page-heading-container clearfix’>
    <section class=”search_form_field”>
    <?php
    do_shortcode( ‘wpdreams_ajaxsearchpro id=4’ );
    // echo “<h4>”.__(‘New Search’,’avia_framework’).”</h4>”;
    echo “<p>”.__(‘Try Another Search’,’avia_framework’).”</p>”;

    get_search_form();
    echo “<span class=’author-extra-border’></span>”;
    ?>
    </section>
    </div>

    Thank you

    #11565
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    The do_shortcode() function call must be echoed, so try changing this line:

    [php]do_shortcode( ‘wpdreams_ajaxsearchpro id=4’ );[/php]

    to this:

    [php]echo do_shortcode( ‘[wpdreams_ajaxsearchpro id=4]‘ );[/php]

    That should give you an output.

    #11566
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Also, I just noticed the shortcode brackets missing:

    [php]echo do_shortcode( ‘[wpdreams_ajaxsearchpro id=4]‘ );[/php]

    #11567
    thorntonp72thorntonp72
    Participant

    Wow that was damn quick and worked like a charm. Thank you very much for your help once again!!!

    #11568
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.