Viewing 9 posts - 31 through 39 (of 39 total)
  • Author
    Posts
  • #857450

    Hi,

    Thank you for your patience.

    I could check your backend noe and found the following problem in your functions.php:

    
    function loop_portfolio_query( $location )
    {
    if ( $location == 'loop-portfolio' )
    {
    global $avia_config;
    if(isset($avia_config['new_query'])) {
    $avia_config['new_query']['orderby'] = "rand";
    query_posts($avia_config['new_query']);
    }
    }
    }
    add_action( 'avia_action_query_check' , 'loop_portfolio_query', 10, 1 );
    

    Using rand: SQL server queries the posts on every request randomly (as requested) and is not knowing which were in the last queries.

    If you like this, you have to implement a logic to cache which posts were already displayed on which page and exclude those from the subsequent searches. When user returns to an already visited page you have to take the posts from the cache and do not perform a new query.

    Another point:

    You add an action with the same priority as the theme does. It is not guaranteed, which action is performed first. If you want to make sure your query is the last one, you have to use a priority > 10.

    Another point to efficiency:

    The query is performed twice (in theme action and in your action).

    Better solution would be to take a priority of 5, alter the query params as done above and return. Then the theme query uses the modified params for the query.

    Best regards,
    Günter

    #857472

    Erm… that is literal gobbledygook to me, sorry. I’m not a developer and don’t understand any of what you just said. Does that mean you can fix it or not?

    #857851

    Hi,

    In the functions.php file, please adjust the orderby query from “rand” to “date” or “title”. The random query is causing the portfolio items to be repeated on the next or previous pages.

    $avia_config['new_query']['orderby'] = "rand";
    

    Best regards,
    Ismael

    #1063274

    Hello – I have also suffered from this problem with my portfolio grid when using random sort method – just like the OP above..

    I found a way to make sure the entries on the second page are not repeats – without editing any PHP – its just a question of setting the portfolio grid up correctly and setting content to Date and Descending so it lists by newest entry showing top left.


    However I do still have some problems with the functionality of this portfolio grid.

    The grid is setup for 20 items per page. There are currently 24 items/posts in total across several categories.

    1. e..g. IF sorted by DATE-DESCENDING and I click at the TOP to filter by “commercials” and two of the posts are originally showing on portfolio page 1 (Within first 20) and 2 are showing on page 2 (21-24) – THEN it should show all 4 commercial posts together on 1 page when I click the filter button. Even though there are only 4 commercial posts – for some reason it still creates 2 pages and shows 2 on the first and 2 on the second – this is counterintuitive. Is there a fix for this or is there a setting I am missing?

    Hope you can help.
    Thanks
    Pete

    #1063947

    Hi,

    That is not how the filter works. It can only display posts that are present in the current page because it cannot synchronously fetch items from other pages. Only solution to this at the moment is to display all items on a single page.

    Best regards,
    Ismael

    #1064105

    Hi Ismael
    Thanks for the quick reply and clarification. My feeling was that it should have been looking at all portfolio posts in the database and show when filter applied on one page . I guess its just a small aesthetic limitation at the moment.

    To help me overcome this and take your suggestion to display all posts on one page – is there a CSS way or other method – to make my post classic grid stretch across the entire width of the screen ? – so that users on iMac 27″ like myself see a wide grid ofl the full portfolio? I realise that is a little bit like a masonry portfolio but I want to do it with my classic grid of 520x370px images as you can see currently.

    Hope you can help.
    thanks
    pete

    #1064441

    Hi,

    That is possible but you may need to adjust a few more elements. You can start with this:

    .responsive .page-id-2270 .container_wrap_first .container {
        padding: 0;
        max-width: 100%;
    }

    Best regards,
    Ismael

    #1064561

    thanks for the quick reply Ismael :)

    That worked nicely to set the width. I changed the padding to give a 10px margin all around because the sort filters “All | Commercials…” were pressed hard against the left hand edge of the screen.

    A couple of questions just to fine tune the layout. Hope you can help.

    1. If I want to have the sort filters padded from the left but keep the actual grid right on the screen edge (as per your CSS) how can I set that left hand side padding for the sort filter heading only “All | Commercials…” etc. You show this in your demo here:-

    2. How can I change the font size for the sort filters – I want it to match the font size for my main menu – but cannot see a place to set this up.

    3. How can I make my sort filters “All | Commercials…” sit exactly in the middle vertically on the top margin? Like you have in the demo here:-

    here;s my page at the moment:
    http://british-voiceover.co.uk/video-voiceover/

    Thanks again,
    Pete

    #1065900

    Hi,

    Thanks for the update.

    Add a grid row element, set it to have a single cell and then move the portfolio grid element inside. That should take care of the padding issues and make the portfolio grid full width.

    If you have further inquiries, please create a new thread.

    Best regards,
    Ismael

Viewing 9 posts - 31 through 39 (of 39 total)

You must be logged in to reply to this topic.