orion3dgames / gridder

A jQuery plugin that displays a thumbnail grid expanding preview similar to the effect seen on Google Images.
http://orion3dgames.github.io/gridder/
461 stars 130 forks source link

wordpress compatibility problem #66

Open julianrob77 opened 6 years ago

julianrob77 commented 6 years ago

hi,

it seems the grid is not working with wordpress. the list items stack

I have enqueued the styles and js as per your demo, so I am unclear why this is happening. it is NOT due to theme CSS. i have tried this with basic theme and without theme styles.

http://landmarkdraft.dreamhosters.com/grid-test/

can you assist me in this please?

thanks

J

julianrob77 commented 6 years ago

Hi there,

Ive got this fully integrated into wordpress loop now. You may be curious as to how this is done.

the loop (for post type staff in this case):


<div class="container">
            <ul class="gridder">
<?php $args = array( 'post_type' => 'staff', 'orderby' => 'menu_order', 'order' => 'ASC');
    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post(); ?>
       <li class="gridder-list" data-griddercontent="#gridder-content-1"><div class="img-fluid" id="loop"><?php the_post_thumbnail(); ?></div></li>
<div id="gridder-content-1" class="gridder-content">
                <div class="row">
                    <div class="col-sm-6">
                        <?php the_post_thumbnail( 'full', array( 'class' => 'img-responsive' ) ); ?>
                    </div>
                    <div class="col-sm-6">
                        <h3><?php the_title() ?></h3>
                         <p><?php the_content() ?></p>
                    </div>
                </div>
            </div>
<?php endwhile; ?>
</ul>
</div>

I had to change the content jQuery so that it properly reads the correct div. as it stands it does not

// Load #ID Content thecontent = $("li.selectedItem").nextAll( "#gridder-content-1" ).html(); processContent(myself, thecontent);

to be honest I would think you can make this a wordpress plugin and make a bit of money mate.

thought i would share my progress with you. you will be credited on the site.

thanks

J