• Resolved johndoe01

    (@johndoe01)


    Greetings. I’m having problems with the gallery inside an ad.
    I received a wordpress site with other Ads sistem and i disabled it to allow compatibility. However i’m doing adequations in localhost
    What is the problem i have:
    The Gallery inside the ad is listing ALL the site’s images, besides the ad’s ones.
    I switched into a Blank theme to see for compatibility issues and the Blanjk one (blankslate) works there. I compare Console callings and i have no idea what’s going on or from where i can start, since for the layout i had to call the CSS files of the plugin manually.

    I’m not sure from where to begin since i’m trying to debug and does not appear any evident error.

    Thanks for reading

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    the images for the gallery on Ad details page are loaded by Adverts_Gallery_Helper::load_attachments() function, you will find it in wpadverts/includes/class-gallery-helper.php on line about 82.

    If it works with one theme but does not work in other then most likely the theme which loads all the attachments is customizing WP query in some way which makes the query load all images.

    You can try to prevent it by changing in the load_attachment() the code

    
    $args = array(
        'post_parent' => $post_id,
        'post_type' => 'attachment',
        'posts_per_page' => -1,
    );
    

    to

    
    $args = array(
        'post_parent' => $post_id,
        'post_type' => 'attachment',
        'posts_per_page' => -1,
        'suppress_filters' => true
    );
    
    Thread Starter johndoe01

    (@johndoe01)

    Thanks for replying.
    However i (sort of) solved it before this:
    Initially i copied the single-advert.php from the plugin to the template and added the template’s missing components. After emptying the whole Media library (with exception of a few required images) i gave up and went back to square 1.

    I took the single/page from the working template (Blankslate). Copied it and placed it in the template folder as Control. Now the Gallery loads only the Ads Images. (The original goal of this post). Then i set some missing tags to fit into actual design and fits well.

    However now i result solving a problem bringing another.
    Now i can have the big gallery which you scroll into items one by one. But the thumbnails one i only have the thumbnails.

    Now that you mention such array i’ll try to check if something of the actual template is doing conflict in a way that does not allow to see the big image and the thumbnails below.

    It’s a shame that i can’t paste or attache images here since it will be a lot of help, since i’m editing in localhost.

    Thanks in advance.

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    you can paste a link to an image uploaded to for example Dropbox, or if you do not want to share the screens publicly send me a message using contact form at https://wpadverts.com/contact/ i will reply back to you and then you will be able to send me attachments like with any other email.

    Thread Starter johndoe01

    (@johndoe01)

    Greetings. Well, this could take some time since i have no idea from where to begin.
    This is what i got right now. Gallery with Next and Previous Buttons. And that works.

    View post on imgur.com

    This is the Control on Blankslate Template:

    View post on imgur.com

    As soon as i change to Thumbnails slider:

    View post on imgur.com

    In the template becomes like this:

    View post on imgur.com

    While on blankslate shows as it must be (and i’ll need to tweak thumbnails once i solve it)

    View post on imgur.com

    Something to add is that in both cases, in the template, the show contact information button does not work while on blankslate it does, even with the loading icon:

    View post on imgur.com


    https://i.imgur.com/jyl7CzP.png (Drags to an anchor)

    And i disabled the JS of the theme, to troubleshoot but there is no change.
    Thanks for the answer.

    Thread Starter johndoe01

    (@johndoe01)

    By the way. Console throws me this: https://i.imgur.com/WK7jycs.png
    And i don’t know where to define it.

    EDIT: Checked the console and in blankslate there IS a value but on the template it DOES NOT load on the main one.

    • This reply was modified 4 years, 6 months ago by johndoe01.
    Thread Starter johndoe01

    (@johndoe01)

    Took me some time to figure it out.

    Like in a form of debugging i tried to transplant components from one template to a child of blankslate but i was getting on the same point again. So in the footer i debugged item by item and found out that was missing <?php wp_footer(); ?> and the thumbnail view with window and the Contact information Now Works as intended, however, deploys and closes immediately on the original template, and in the franken-blankslate opens and closes at will.

    View post on imgur.com

    View post on imgur.com

    TLDR: It resulted than the original template didn’t had <?php wp_footer(); ?>

    Thread Starter johndoe01

    (@johndoe01)

    Fully Solved!
    Since when i set initially and havent suspected of the wp_footer() string. I deleted the function that loaded the JS copies i set on the folder doing a redundancy. Now that everything is loaded as it should be. I could say that this is Fully Solved.
    Hope when i mark this doesnt get locked.

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    ok great, thanks for the feedback, i am glad you have it resolved :).

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Gallery inside ad gone haywire’ is closed to new replies.