Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › add ajax field onto the page
- This topic has 4 replies, 2 voices, and was last updated 10 years, 8 months ago by
Ernest Marcinko.
-
AuthorPosts
-
September 12, 2015 at 9:07 pm #5907
Dominik Lechner
Participanthi i would like to add the field onto the site http://www.eis-selber-machen.com/rezepte/ but i have here the existing search fielt without your tool… Now, i would like to add here in the same style your plugin. I have add onto the code
[code] <div id="search-form-recipes">
<form role="search" method="get" id="search-form" action="<?php echo esc_url( home_url( ‘/’ ) ); ?>">
<input type="text" name="s" placeholder="<?php echo esc_attr_x( ‘Suche hier alle’, ‘progression’ ); ?> <?php $count_posts = wp_count_posts(‘recipe’); echo $count_posts->publish; ?> <?php echo esc_attr_x( ‘Rezepte’, ‘progression’ ); ?>" value="<?php echo esc_attr( get_search_query() ); ?>"/>
<input type="hidden" name="post_type" value="recipe" /> <!– // hidden ‘products’ value –>
<input type="submit" value="Los" id="search-recipes-btn" />
<div class="clearfix"></div></form>
</div>
[/code]
Your Code [wpdreams_ajaxsearchpro id=1] but of course this will not work can you please help ? Because that is a php code what i need or?
Thankjs
September 12, 2015 at 9:08 pm #5908Dominik Lechner
Participant<div id=”search-form-recipes”>
<form role=”search” method=”get” id=”search-form” action=”<?php echo esc_url( home_url( ‘/’ ) ); ?>”>
<input type=”text” name=”s” placeholder=”<?php echo esc_attr_x( ‘Suche hier alle’, ‘progression’ ); ?> <?php $count_posts = wp_count_posts(‘recipe’); echo $count_posts->publish; ?> <?php echo esc_attr_x( ‘Rezepte’, ‘progression’ ); ?>” value=”<?php echo esc_attr( get_search_query() ); ?>”/>
<input type=”hidden” name=”post_type” value=”recipe” /> <!– // hidden ‘products’ value –>
<input type=”submit” value=”Los” id=”search-recipes-btn” />
<div class=”clearfix”></div></form>
</div>
</form>
</div>
[/php]-
This reply was modified 10 years, 8 months ago by
Dominik Lechner.
September 14, 2015 at 11:01 am #5920Ernest Marcinko
KeymasterHi!
There is also a PHP shortcode available for each search instance, and a small chapter in the documentation to help you with the implementation to the themes: http://wpdreams.gitbooks.io/ajax-search-pro-documentation/content/getting_started/search_shortcode_in_themes.html
In your case it’s probably something like this:
[code]<div id="search-form-recipes">
<?php echo do_shortcode(‘[wpdreams_ajaxsearchpro id=1]‘); ?>
</div>[/code]September 14, 2015 at 3:19 pm #5932Dominik Lechner
Participantthanks we will try it… Is here a way to receive a result like google just a automatic suggestion? without images?
September 16, 2015 at 9:41 am #5947Ernest Marcinko
KeymasterHi!
You can disable the description and the images as well, so only the title is visible – that’s as close as it gets to google suggestions.
To disable the images go to the General Options -> Image Options panel.
To disable the description, author etc.. go to the Layout Options -> Results Layout panel. -
This reply was modified 10 years, 8 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.