WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Trying to launch a slider -Where is code for inline loading of posts (9 posts)

  1. helgatheviking
    Member
    Posted 2 years ago #

    If there is more than 1 attachment I'm trying to insert the attached images into a slider/carousel. i have almost everything up and running except that when i'm on my homepage and i click on a thumbnail, the post content is loaded via ajax... so the jquery doesn't work on elements that weren't in the DOM originally.

    however, the only .ajax call i see is in the pageload() function in init.js. (well there are a few others in plugins.js but once unpacked it looks like that call is in reference to some kind of form validation) with .ajax i can successfully add nivo slider's initialization code to the ajax function's success callback which works fine when i load a page directly like so:

    http://www.demo.com/#test-post

    however, my modifications don't get called if i am directly on the index page and then click on the thumbnail for the test-post. i presume the pageload() function doesn't get called in this case.

    the click function for the index thumbnails references a

    $.historyLoad(hash, page);

    function, in the jquery history section of plugins.js but that is packed and totally obfuscated and doesn't the history plugin usually just work so that you can use your browsers back/forward buttons instead of actually loading content?

    additionally, i've tried putting the initialization code in a <script> tag but found out that .post and .ajax always strip script tags when delivering content. so i have to find a way to latch on to the actual ajax call, but i can't find it.

    anyway, if anyone can point me to WHERE i can find the code that loads the posts on the homepage once thumbnails are clicked I should be able to sort it out. i can post back w/ the final 'how to' for adding a slider.

    should i try to use the livequery plugin? though, i'd prefer not to load more scripts if it can be avoided.

    thanks.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

  3. helgatheviking
    Member
    Posted 2 years ago #

    thanks for the reply, but that's just a primer on how to use javascript with WP. i'm way beyond that and not struggling with how to implement scripts, but rather have a very specific jquery question. i know it is a jquery question, but since i'm looking for a specific functionality within a WP theme, i thought i'd post here.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

  5. helgatheviking
    Member
    Posted 2 years ago #

    no offense, but did you read my post? i'm looking for the code within the grid-a-licious theme that is responsible for the ajax/inline loading of posts on the home page?

  6. mokes
    Member
    Posted 2 years ago #

    I know this thread hasn't been touched in two months, but did you ever resolve the issue? I recently ran into the same problem, myself.

  7. helgatheviking
    Member
    Posted 2 years ago #

    forgot i even posted this.

    yes i did resolve it. for starters i added the slider script initialization in w/ the other scripts at the bottom of single-gal.php after that i don't recall everything that i did as there was a lot to do w/ the grid layout and the theme's js was cryptic at best.

  8. turkmen
    Member
    Posted 2 years ago #

    thank you

  9. mokes
    Member
    Posted 2 years ago #

    Thank you so much for the response, but I'm still having a terrible time with this. Did you only work with the init.js, or did you also modify the grid-a-licious.js as well?

Topic Closed

This topic has been closed to new replies.

About this Topic