• Hey guys!

    I am putting up a featured-slider with jQuery, and have som questions regarding query the output.

    The code for it is currently like this;

    <?php query_posts('category_name=hovedsak&showposts=4');?>
    
    <div id="featured">
    	<ul class="ui-tabs-nav">
    	  <?php while (have_posts()) : the_post(); ?>
    		<li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-1">
    			<a href="#fragment-1"><img src="http://fx.itpro.no/img?src=/<?php echo get_post_meta($post->ID, 'toppsakbilde', true) ?>&w=80&h=50&zc=1" alt="<?php the_title(); ?>" />
    			<?php the_title(); ?></a>
    		</li>
    	  <?php endwhile;?>
    	</ul>
    
    	<!-- Display the content -->
    	<div id="fragment-1" class="ui-tabs-panel">
    		<img src="http://fx.itpro.no/img?src=/<?php echo get_post_meta($post->ID, 'toppsakbilde', true) ?>&w=410&h=250&zc=1" alt="<?php the_title(); ?>" />
    		<div class="info">
    			<h2><a href="<?php the_permalink() ?>"><?php the_title();?></a></h2>
    			<p><?php excerpt('18'); ?></p>
    		</div>
    	</div>
    </div>

    And it looks like this; http://img535.imageshack.us/img535/802/20100522003304.jpg

    The tabs to the right is working, but I need the main post to the left to correspond with them to the right.

    How would I do the queries to make that work?

    The important this is the “#fragment-x”.
    The fragment-ID increases for each featured item.

    Hopefully you understand what I want to do.. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter martin.aleksander

    (@martinaleksander)

    Anyone? 🙂

    Thread Starter martin.aleksander

    (@martinaleksander)

    Sorry to bump this again, but I really need help with it.

    <?php
     $featuredquery = "
        SELECT wposts.*
        FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
        WHERE wposts.ID = wpostmeta.post_id
        AND wpostmeta.meta_key = 'article_level'
        AND wpostmeta.meta_value = 'Hovedsak'
        AND wposts.post_status = 'publish'
        AND wposts.post_type = 'post'
        AND wposts.post_date < NOW()
        ORDER BY wposts.post_date DESC
    	LIMIT 0 , 4
     ";
     $featuredposts = $wpdb->get_results($featuredquery, OBJECT);
    ?>
    <div id="featured">
    	<ul class="ui-tabs-nav">
    		<?php if ($featuredposts): ?>
    			<?php foreach ($featuredposts as $post): ?>
    				<?php setup_postdata($post); ?>
    				<li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-1">
    					<a href="#fragment-1"><img src="<?php echo get('artikkelbilde'); ?>&w=80&h=50&zc=1" alt="<?php the_title(); ?>" />
    					<?php the_title(); ?></a>
    				</li>
    			<?php endforeach; ?>
    		<?php else : ?>
    			Ingen innlegg funnet
    		<?php endif; ?>
    	</ul>
    	<!-- Display the content -->
    	<div id="fragment-1" class="ui-tabs-panel">
    		<img src="http://fx.itpro.no/img?src=/<?php echo get_post_meta($post->ID, 'toppsakbilde', true) ?>&w=410&h=250&zc=1" alt="<?php the_title(); ?>" />
    		<div class="info">
    			<h2><a href="<?php the_permalink() ?>"><?php the_title();?></a></h2>
    			<p><?php excerpt('18'); ?></p>
    		</div>
    	</div>
    </div>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help with ‘featured-slider’’ is closed to new replies.