-
AuthorSearch Results
-
January 27, 2017 at 5:14 pm #86166
In reply to: Configuration questions
AnonymousInactiveThanks for the quick response.
Re: 1 & 2 I can wait for the next release, these are nice to have but not crucial for the launch.
Judging by your answer I assume that it also won’t be possible to show the list of active filters in the archive page? That is, on top of the page the user would see that he’s filtered by category 1 and 2 and could quickly remove some of the filters? Unless there is a shortcode for that?
Re 3: In short, my archive page features a 3rd party media player (by waveplayer.info) rendered via the shortcode. While AJAX refresh does give me all the posts I expect, the player isn’t rendered properly. I assume it’s missing the js / styles it needs.
While I understand how it works in principle, I guess I just need a bit of a push in the right direction. Specifically, how to identify what the waveplayer plugin needs and how to include it within the AJAX request.
Thanks in advance!
January 26, 2017 at 2:55 pm #85731
TrevorParticipantJust in case this happens again, this is the code I wrote:
<?php /** * Search & Filter Pro * * Sample Results Template * * @package Search_Filter * @author Ross Morsali * @link http://www.designsandcode.com/ * @copyright 2015 Designs & Code * * Note: these templates are not full page templates, rather * just an encaspulation of the your results loop which should * be inserted in to other pages by using a shortcode - think * of it as a template part * * This template is an absolute base example showing you what * you can do, for more customisation see the WordPress docs * and using template tags - * * http://codex.wordpress.org/Template_Tags * */ global $searchandfilter; $sf_current_query = $searchandfilter->get(5048)->current_query(); if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) { echo ''; } else { if ( $query->have_posts() ) { ?> Found <?php echo $query->found_posts; ?> Results<br /> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br /> <div class="pagination"> <div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div> <?php /* example code for using the wp_pagenavi plugin */ if (function_exists('wp_pagenavi')) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> <div class="slz-shortcode sc_block_posts "><div class="slz-template-03 "> <div class="slz-list-block slz-column-2"> <?php while ($query->have_posts()) { $query->the_post(); ?> <div class="item"> <div class="slz-block-item-01 style-1"> <?php if ( has_post_thumbnail() ) {?> <div class="block-image"> <a href="<?php the_permalink(); ?>" class="link"> <?php the_post_thumbnail("full", array( 'class' => 'img-responsive' ));?> </a> </div> <?php } ?> <div class="block-content"> <div class="block-content-wrapper"> <a class="block-title" href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <ul class="block-info"> <li><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>"><span class="author-label">By </span><span class="author-text"><?php the_author(); ?></span></a></li> <li><a href="<?php the_permalink(); ?>" class="link date"><?php the_date(); ?></a></li> <li><a href="<?php the_permalink(); ?>#comments" class="link comment"><?php comments_number();?></a></li> <li><a href="<?php the_permalink(); ?>" class="link view">?? Views</a> </li> <li><?php the_category(); ?></li> </ul> <div class="block-text"><?php echo get_the_excerpt(); ?></div> </div> </div> </div> </div> <?php } ?> </div> </div></div> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br /> <div class="pagination"> <div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div> <?php /* example code for using the wp_pagenavi plugin */ if (function_exists('wp_pagenavi')) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> <?php } else { echo "No Results Found"; } } ?>
January 25, 2017 at 9:14 am #85201In reply to: Almost there, struggling with last steps
TrevorParticipantMarketify should work the easy way. If you go to wp-content/themes/marketify (I think), edit the functions.php file, it needs to look something like this (where the 63 is the ID number of the form you made, so change that):
<?php /** * Marketify child theme. */ function marketify_child_styles() { wp_enqueue_style( 'marketify-child', get_stylesheet_uri() ); do_action( 'search_filter_prep_query', 63 ); } add_action( 'wp_enqueue_scripts', 'marketify_child_styles', 999 ); /** Place any new code below this line */
January 19, 2017 at 12:01 pm #83677In reply to: How display Result page as Grid ?
TrevorParticipantI have written a new results.php for you:
<?php /** * Search & Filter Pro * * Sample Results Template * * @package Search_Filter * @author Ross Morsali * @link http://www.designsandcode.com/ * @copyright 2015 Designs & Code * * Note: these templates are not full page templates, rather * just an encaspulation of the your results loop which should * be inserted in to other pages by using a shortcode - think * of it as a template part * * This template is an absolute base example showing you what * you can do, for more customisation see the WordPress docs * and using template tags - * * http://codex.wordpress.org/Template_Tags * */ if ( $query->have_posts() ) { ?> Found <?php echo $query->found_posts; ?> Results<br /> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br /> <div class="pagination"> <div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div> <?php /* example code for using the wp_pagenavi plugin */ if (function_exists('wp_pagenavi')) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> <div class="col-9 hb-equal-col-height hb-main-content"> <div id="hb-blog-posts" class="hb-blog-grid masonry-holder clearfix" data-layout-mode="fitRows" data-categories="" data-column-size="col-4"> <?php while ($query->have_posts()) { $query->the_post(); ?> <article id="post-<?php echo get_the_ID();?>" class="col-4 post-<?php echo get_the_ID();?> post type-post status-publish format-standard has-post-thumbnail hentry" itemscope="" itemtype="http://schema.org/BlogPosting"> <div class="featured-image"> <a href="<?php the_permalink(); ?>"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail("small"); ?> <div class="featured-overlay"></div> <div class="item-overlay-text" style="opacity: 0;"> <div class="item-overlay-text-wrap" style="padding-top: 0px;"> <span class="plus-sign"></span> </div> </div> <?php } ?> </a> </div> <div class="post-content"> <div class="post-header"> <h2 class="title" itemprop="headline"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> </div> <p><?php echo get_the_excerpt(); ?> <br /><a href="<?php the_permalink(); ?>" class="read-more">Read More</a> </p> </div> </article> <?php } ?> </div> </div> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br /> <div class="pagination"> <div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div> <?php /* example code for using the wp_pagenavi plugin */ if (function_exists('wp_pagenavi')) { echo "<br />"; wp_pagenavi( array( 'query' => $query ) ); } ?> </div> <?php } else { echo "No Results Found"; } ?>
January 18, 2017 at 4:43 pm #83471In reply to: Increase Indentation on list
AnonymousInactiveThank you.
My php isn’t that great, would it would be something like;
function filter_function_name($input_object, $sfid=87)
{
if($input_object[‘name’]==’sf-level-1′)
{
//udpate this field before rendering
$input_object[‘attributes’][‘style’] = ‘margin-left:50px;’;
}return $input_object;
}
add_filter(‘sf_input_object_pre’, ‘filter_function_name’, 10, 2);January 17, 2017 at 11:45 am #83050In reply to: Marketify – I cant not make it works
TrevorParticipantWhat does your child theme functions.php look like? It should look like this:
<?php /** * Marketify child theme. */ function marketify_child_styles() { wp_enqueue_style( 'marketify-child', get_stylesheet_uri() ); do_action( 'search_filter_prep_query', 63 ); } add_action( 'wp_enqueue_scripts', 'marketify_child_styles', 999 ); /** Place any new code below this line */
January 14, 2017 at 1:13 pm #82378Topic: No longer searching
in forum Search & Filter Pro
AnonymousInactiveAll of a sudden the search forms have stopped sorting. The page is here: https://intrepidexposures.com/photo-tours/
Tweaks to code as per previous threads here:
// Search Filter function filter_input_object($input_object, $sfid) { if(($input_object['name'] == '_sfm_workshop_location') || ($input_object['name'] == '_sfm_tour_style') || ($input_object['name'] == '_sfm_tour_leader')) { $new_options = array(); //the options added to this will replace all existing optoins in the field foreach($input_object['options'] as $option) { if ($option->value !== "") { //check to see if the option has a parent $parent_id = wp_get_post_parent_id($option->value); if(!$parent_id) { //then this option does not have a parent, so it must be a parent itself, add it to the new array $option->label = get_the_title($option->value); array_push($new_options, $option); } } } //now we have an array with only parent options in, so simply replace the one in the input object $input_object['options'] = $new_options; } return $input_object; } add_filter('sf_input_object_pre', 'filter_input_object', 10, 2);
Any ideas?
January 12, 2017 at 4:32 pm #81812Topic: Styling search bar css
in forum Search & Filter Pro
AnonymousInactiveHello, I’m trying to style the search bar on this page with css. I’ve managed to style the submit button using the .searchandfilter input[type=submit] but I can’t see what the css div class is for the search bar. please can you help?
January 5, 2017 at 10:28 am #80210
TrevorParticipantThere were a couple of errors in that, so I have re-coded it (I am not sure about the do_shortcode bit, but I have left that as is):
<?php /** * Search & Filter Pro * * Sample Results Template * * @package Search_Filter * @author Ross Morsali * @link http://www.designsandcode.com/ * @copyright 2015 Designs & Code * * Note: these templates are not full page templates, rather * just an encaspulation of the your results loop which should * be inserted in to other pages by using a shortcode - think * of it as a template part * * This template is an absolute base example showing you what * you can do, for more customisation see the WordPress docs * and using template tags - * * http://codex.wordpress.org/Template_Tags * */ global $searchandfilter; $sf_current_query = $searchandfilter->get(3552)->current_query(); if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) { echo "make your selection"; } else { if ( $query->have_posts() ) { echo '<div class="row">'; while ($query->have_posts()) { $query->the_post(); ?> <div class="col-md-3 popmake-<?php the_ID();?>" data-do-default="" style="cursor: pointer;"> <h3 style="text-align: center;"><?php the_title(); ?></h3> <p style="text-align: center;"><?php do_shortcode(the_excerpt()); ?></p> </div> <?php echo '</div>'; } } else { echo 'No Results Found'; } } ?>
That may make no difference, but give it a try.
January 5, 2017 at 10:20 am #80206
AnonymousInactiveshure!
<?php /** * Search & Filter Pro * * Sample Results Template * * @package Search_Filter * @author Ross Morsali * @link http://www.designsandcode.com/ * @copyright 2015 Designs & Code * * Note: these templates are not full page templates, rather * just an encaspulation of the your results loop which should * be inserted in to other pages by using a shortcode - think * of it as a template part * * This template is an absolute base example showing you what * you can do, for more customisation see the WordPress docs * and using template tags - * * http://codex.wordpress.org/Template_Tags * */ global $searchandfilter; $sf_current_query = $searchandfilter->get(3552)->current_query(); if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) { echo "make your selection"; } else { if ( $query->have_posts() ) { echo "<div class=\"row\">"; while ($query->have_posts()) { $query->the_post(); ?> <div class="col-md-3 popmake-<?php the_ID();?> data-do-default="" style="cursor: pointer;"> <h3 style="text-align: center;"><?php the_title(); ?></h3> <p style="text-align: center;"><?php do_shortcode(the_excerpt()); ?></p> </div> <?php echo "</div>"; } } else { echo "No Results Found"; } } ?>
-
AuthorSearch Results
-
Search Results
-
Topic: No longer searching
All of a sudden the search forms have stopped sorting. The page is here: https://intrepidexposures.com/photo-tours/
Tweaks to code as per previous threads here:
// Search Filter function filter_input_object($input_object, $sfid) { if(($input_object['name'] == '_sfm_workshop_location') || ($input_object['name'] == '_sfm_tour_style') || ($input_object['name'] == '_sfm_tour_leader')) { $new_options = array(); //the options added to this will replace all existing optoins in the field foreach($input_object['options'] as $option) { if ($option->value !== "") { //check to see if the option has a parent $parent_id = wp_get_post_parent_id($option->value); if(!$parent_id) { //then this option does not have a parent, so it must be a parent itself, add it to the new array $option->label = get_the_title($option->value); array_push($new_options, $option); } } } //now we have an array with only parent options in, so simply replace the one in the input object $input_object['options'] = $new_options; } return $input_object; } add_filter('sf_input_object_pre', 'filter_input_object', 10, 2);
Any ideas?
Topic: Styling search bar css
Hello, I’m trying to style the search bar on this page with css. I’ve managed to style the submit button using the .searchandfilter input[type=submit] but I can’t see what the css div class is for the search bar. please can you help?