AnonymousInactive
Hi Ross,
Thanks for this.
I was using Shortcodes display method before, but will change it to archive in order to use the Masonry display.
However, with the archive technique, how do display the search results on the same page. It seems to direct to another URL when I switch to Archive method.
AnonymousInactive
Hi Ross, I need to integrate your plugin with my new theme.
The template that outputs the search results has this code:
<?php
// =============================================================================
// VIEWS/GLOBAL/_INDEX.PHP
// -----------------------------------------------------------------------------
// Includes the index output.
// =============================================================================
$stack = x_get_stack();
if ( is_home() ) :
$style = x_get_option( 'x_blog_style', 'standard' );
$cols = x_get_option( 'x_blog_masonry_columns', '2' );
$condition = is_home() && $style == 'masonry';
elseif ( is_archive() ) :
$style = x_get_option( 'x_archive_style', 'standard' );
$cols = x_get_option( 'x_archive_masonry_columns', '2' );
$condition = is_archive() && $style == 'masonry';
elseif ( is_search() ) :
$condition = false;
endif;
?>
<?php if ( $condition ) : ?>
<?php x_get_view( 'global', '_script', 'isotope-index' ); ?>
<div id="x-iso-container" class="x-iso-container x-iso-container-posts cols-<?php echo $cols; ?>">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( $stack != 'ethos' ) : ?>
<?php x_get_view( $stack, 'content', get_post_format() ); ?>
<?php else : ?>
<?php x_ethos_entry_cover( 'main-content' ); ?>
<?php endif; ?>
<?php endwhile; ?>
<?php else : ?>
<?php x_get_view( 'global', '_content-none' ); ?>
<?php endif; ?>
</div>
<?php else : ?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php x_get_view( $stack, 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php else : ?>
<?php x_get_view( 'global', '_content-none' ); ?>
<?php endif; ?>
<?php endif; ?>
<?php pagenavi(); ?>
Hi there
Creating a layout for your search results is exactly the same as creating a layout for a regular WordPress template – so really there are many ways to achieve what you want, however S&F does not do this for you.
There are plenty of resources out there but I guess you will want something along the lines of:
If you are looking for a pintrest style layout then there are resources out there (I haven’t tested any personally) –
http://www.danbirlew.com/updated-masonry-in-wordpress/
http://www.wpbeginner.com/wp-themes/how-to-use-masonry-to-add-pinterest-style-post-grid-in-wordpress/
Thanks
Thanks
AnonymousInactive
interesting question
after looking to ryan’s code, i managed to do this with this function
$(".searchandfilter").on("sf:ajaxfinish",function(){
var area = jQuery('.isotope-area');
setTimeout(function() {
area.isotope({
itemSelector: '.column',
masonry: {
columnWidth: 1
}
});
}, 150);
});
If this can help somebody else…
AnonymousInactive
Thank you Ross. I think I’ll use results.php and will just add some code from the masonry template to make it look decent.
Can you give me some guidance/directions on how to find which part of my theme is causing daterange field not working?
Hey Dmitriy
To create your layout as you mention is going to require a fair bit of coding – you’ll need some decent knowledge of html/css/js…
Not sure if you’ve read the differences between archive & shortcode methods:
http://www.designsandcode.com/wordpress-plugins/search-filter-pro/docs/display-results/
Anyway, if you’re trying to create a masonry layout based on something existing in your theme, then the first thing I would do is is copy the html / loop structure from one of your templates that is using masonry,
Either find the PHP file responsible for displaying the masonry layout in your theme directory, or alternatively view the source HTML of a page which is displaying a masonry layout.
You’ll have to copy the html over to your results.php – but it might not be straight forward – this will require tweaking.
In all cases I’m aware of, any true masonry layout requires Javascript, to make everything fit together and stack nicely. You’ll have to figure out how to trigger the masonry via JS in your theme. You’ll need to load the masonry script whenever the page loads, and whenever new results are loaded in – check the first question on the FAQs on how to detect when new results have loaded –
http://www.designsandcode.com/wordpress-plugins/search-filter-pro/faqs/
As mentioned above, it requires a certain level of knowledge to get a masonry layout working in your theme.
Alternatively, if you used the archive method (and overcame any issues there), I’m sure the html structure would already be correct, however you would still need to apply the masonry/JS logic to these pages.
Thanks
AnonymousInactive
OK, I managed to get shortcode working per your suggestions. I created a new page w/o any sidebar and put both search form and search results shortcodes in it, and it’s started to work. But I noticed that it works only if ‘The relationship between tag, category and taxonomy fields’ is set to either DEFAULT, or OR. AND doesn’t work.
I also tried with both shortcode and S&F widget in the sidebar and it also works!!
Now, how do I use my masonry template to display results instead of your default template you have? As I said the template has a more complex custom query code in it. If I post it here can you give me a suggestion how to modify it?
Thanks,
D.
AnonymousInactive
Here’s the issue I’m having. I want to display search results using one of my template pages (blog masonry style).
I’ve tried both FREE version and PRO. Actually FREE version worked fine even w/o any template modifications, but the problem is it doesn’t allow to selectively display categories and the daterange field doesn’t work (yes I tried it in latest ver. of Chrome and Firefox). In your demo site the datarange fields are working which makes me believe there’s some conflict with either my theme or one of the plugins I’m using.
So I’d pretty happy with FREE version if it had options to control which categories appear in the results and I need datefields to work.
Anyway that was with FREE version, now PRO version works partially and only using shortcode method. The results page displays every post I have, it doesn’t filter them by category or tag. When I change the category or tag then results page reloads but it displays all posts every time.
Using archive page doesn’t work at all no mater what custom template I tries, search.php, archive.php, and a coupe others. I guess these need to be modified per your suggestion in FAQ to remove custom query but it’s a bit complicated (it includes some extra functions to allow user selected options in the admin panel of the theme). So I don’t feel qualified enough to do this change myself. Should I send you my template pages for you to look at? And, as I said the daterange fields are not working (perhaps there’s jQuery conflict with another plugin?).
So please can you take a look and give me your advice? The test site url link is : http://rsdasa.5notedesign.ninja/classes/
I can send you my WP login details so you can check my setup.
Thank you,
Dmitriy
AnonymousInactive
I’ve resolved the issue by adjusting CSS of results.php : it was calling some function of the theme to define CSS classes, and I think it was not working when ajaxed.
However I DO have a pb of JS : as below, on page load, no pb : some JS is called and create a nice masonry grid.
But when ajaxing the results, the grid is not looking good. I’ve checked console, but I don’t know what to look at.. One thing is true : when I disable JS, the load page has the same mess, so definitely some JS is not loading in ajax results.
Any idea ? 😀
AnonymousInactive
Hi,
I installed the S&F Pro plugin on my website http://inside.revelator.com/design/
I use a theme that show my posts in masonry.
I created a simple search form with a search input and a category filter, but when I choose a category, the results are not filtered.
Can you tell me what I missed ?
Thank you