Forums Forums Search Search Results for 'Masonry'

Viewing 7 results - 321 through 327 (of 327 total)
  • Author
    Search Results
  • #5870

    Anonymous
    Inactive

    Hi,

    I don’t understand how the new Ajax instructions work with the styling of the search display.

    If I choose “Load results using Ajax” and “Use a shortcode to display results” the option for Page template disappears. [http://imgur.com/RPYAhp2]

    I am using this theme (https://wordpress.org/themes/baskerville). The search results, as well as the posts are displayed in a grid form (masonry layout). This is how I want to display the search results from using the Search and Filter plugin as well.

    I understood that I would be able to do this by making the custom template search.php from my theme, but this is not working, even if I have the Ajax option disabled.

    I just want the results to appear in the same way search results appear on my theme.

    Please help.

    Thanks.

    #1824

    Ross
    Keymaster

    Hey Pamella

    Thanks, always nice to hear positive feedback ๐Ÿ™‚

    RE your issues… basically customising the results page is as you mention to do with template development which is slightly out of the ‘realm’ of support for this plugin but I can point you in the right direction.

    Basically, the results template works the same as a post archive page, which means that is uses the main loop to display your posts – therfore some of those plugin for sure won’t be compatible, because they run their own queries to get results so bear this in mind when going forward.

    RE the post content displaying, take a look at the WordPress documentation about the loop – you can use all the functions/template tags from here (http://codex.wordpress.org/The_Loop) so to display an excerpt rather than the full content replace the_content() with the_excerpt() – just check the docs.

    To display results in a grid like fashion I think these tutorials will help:
    http://www.wpbeginner.com/wp-themes/how-to-create-a-grid-display-of-post-thumbnails-in-wordpress-themes/

    http://www.transformationpowertools.com/wordpress/posts-in-columns-a-new-twist-on-an-old-problem or http://www.transformationpowertools.com/wordpress/playing-with-columns-stacking-posts-grid-style

    What I’m sure would be even better would be using a masonry style layout, but this is more difficult and requires more work, so depends on how comfortable you are coding – there are plenty of tutorials out there if you just google “display posts as masonry” – and look for tutorial not plugins which will often not use the main loop.

    Thanks

    #1209

    Ross
    Keymaster

    Hey Piotr this is because your page height is dynamically being set by your scripts – not sure which one to be honest but probably something to do with masonry.

    You need to make sure that masonry refreshes and does its recalculation once the new page content has loaded – you can detect when the AJAX has finished loading in jquery here:

    http://api.jquery.com/ajaxcomplete/

    Then once you detect Ajax complete, you should tell masonry to refresh (I’m not sure how to do that with your specific setup)

    Thanks

    #1193

    Ross
    Keymaster

    Woohoo ๐Ÿ™‚ Its working, and as I mentioned before…

    This template is not using the main WordPress loop

    Instead it makes its own query within the page itself:

     query_posts('numberposts=-1&post_type=post&paged='.$paged);
    

    Which I think it not so good..

    I copied the masonry template to sf-masonry and removed this line and added in some stuff to use the main loop ๐Ÿ™‚

    if (have_posts()) : while (have_posts()) : the_post();

    ๐Ÿ™‚

    #1178

    Ross
    Keymaster

    Hey Piotr

    I’m going to try to help and point you in the right direction…

    Basically, a good results template normally is an archive template or the search template (archive.php or search.php), so for this example lets choose search.php.

    Duplicate search.php and call it something else (eg, sf-results.php) – now we have a custom results template that is separate from the rest of your site…

    So for testing, make sure you set the template of your search results (in S&F settings) to sf-results.php.

    Now we have a clean template setup (not masonry yet) so test it is all working make sure you always use the search results url, which is this one: http://maneuver.nazwa.pl/WWW/nstyle/?sfid=55

    Now we know this template is working we need to get it work with Masonry..

    There are many tutorials on how to do this so I would recommend the following one, and make sure all modifications are to sf-results.php.

    http://www.bluelimemedia.com/2012/04/30/jquery-masonry-and-wordpress/

    If you can follow this tutorial and get a layout working (forget about if the search works for now, just make sure the template is working then I can help you with the next steps… ๐Ÿ™‚

    BTW, if you can pls send me your login details (and FTP) and I will try to have a quick look myself – I have an idea which might make this all very easy.

    Thanks

    #1169

    Ross
    Keymaster

    I thought I saw the masonry layout working with the search form before?

    Try to clear your cache and disable and caching plugins you may have… There could be something interfering…

    The plugin modifies the results of the main WP loop, so all your template needs to do is use this loop….

    This should be completely possible unless your masonry plugin fetches the results using its own instance of WP_Query – which is not the right way to do it really…

    Did the Masonry layout ever work with the search form? I thought I saw it did!

    #1167

    Anonymous
    Inactive

    I changed the template (for the records) back for the:
    search.php,

    instead of desired one:
    blog-masonry-page.php

    That disabels the filter (changing for this template in the plugin`s setup).

    What can we do now?

Viewing 7 results - 321 through 327 (of 327 total)