Ajax, Permalinks and post_thumbnail

As i’m new to AJAX, i’m still learning a lot and have learned a lot over the past weeks. I do need some more assistance on an AJAX issue though:

I’m using the following code to display post_thumbnails in a slider which when clicked go to the specific portfolio piece:

Read More
<ul id='portfolio-list'>
     <?php query_posts('cat=16&post_type=portfolio'); ?>
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
            <li class="<?php foreach((get_the_category()) as $category ) { echo $category->slug . ' '; } ?>all">
                    <?php if ( has_post_thumbnail() ) { ?>
                <a id="caseStudy" href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail(); ?></a>
                <?php } else { ?>
                <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><img src="<?php bloginfo('template_url'); ?>/images/post-thumb.jpg" width="141" height="73" alt="<?php the_title_attribute(); ?>" /></a>
                    <?php } ?>
            </li>
        <?php endwhile; endif ?>
        <?php wp_reset_query(); ?>
    </ul>

What i’m looking to do is to have the portfolio piece content load on the same page.

I’m using this code:

var ajax_load = "<center><img style='margin-top: 150px;' src='<?php bloginfo("template_url"); ?>/images/loader.gif' alt='Loading...' /></center>"; 

                var loadUrl = "http://localhost:8888/cnNew/?page_id=4"; 
                    $("#ourTeam").live('click', function(){
                        $("#teamLoad")
                            .html(ajax_load)
                            .load(loadUrl + " #innerTeam")
                    });

to load other items onto the page but can’t seem to get this way of calling it to work with the dynamically listed content. Can someone provide some assistance on the best way to achieve what i’m looking to do or at least a direction?

Thanks!

Related posts

Leave a Reply

1 comment