WordPress.org

Ready to get started?Download WordPress

Forums

Selecting specific category to display in jquery sliding panels (3 posts)

  1. Calicosun
    Member
    Posted 3 years ago #

    I have very limited knowledge of working with jquery scripts (none!?) so am not quite sure how to ask this question.

    After many hours (days/weeks/months - have been looking for a long time) trying to find the perfect way to present my portfolio work I finally found what I was looking for but cannot for the life of me figure out how to display just a specific category.

    The theme I found was: http://paulicio.us/items/view/28/viewport-a-free-wordpress-theme which I love as is simple and fits easily into the theme I have created.

    The starting code for calling the posts into a sliding gallery is as follows:

    <?php if (have_posts()) : ?>
    
    				<?php while (have_posts()) : the_post(); ?>
    
    				<div class="panel" id="post-<?php the_ID(); ?>" title="<?php the_title() ?>">
    					<div class="wrapper">
    						<?php
    							$media_type = get_post_meta($post->ID, 'lead_type', true);
    							$media = get_post_meta($post->ID, 'lead_image', true);
    
    							/* Display relevant code based on media type */
    
    							if(stristr($media, '.flv') || $media_type == 'flash') {
    
    								/* Grab video preview image if the user has added one */
    
    								$video_preview = get_post_meta($post->ID, 'video_preview', true); ?>
    								<span id="video-<?php the_ID(); ?>" class="flashvideo" style="height: 600px; width: 940px;">
    									<script type="text/javascript">

    Is anyone able to tell me how to specify that I only want work-post category to display and still have the slider working? I can get one of the posts to display but the script doesn't seem to work doing this. The only way I can get it to work is if I let it display all posts which I don't want as some posts are informational without images.

    I know I have not explained this clearly - not sure what is required.

    Thanks so much

  2. keesiemeijer
    moderator
    Posted 3 years ago #

    Put this before your loop query_posts( 'cat=4' );. Change the category ID to your work-post category ID.

    <?php query_posts( 'cat=4' ); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <!-- the rest of the loop -->
  3. Calicosun
    Member
    Posted 3 years ago #

    Thank you so much for taking the time to reply. I have tried a few different calls to get the specific category and works fine usually but the slider doesn't work.

    I actually think the problem is more to do with the fact that the slider works fine if called on the index page ie. http://www.sitename.com/#, even when specifying the category I would like but I can't seem to get it to work if I use a static page, apply a template and put the code from the index page into the template to all the posts. The biggest problem is 'me' as I don't have any knowledge of JQuery scripts so don't know where to start looking. Have spent the past few days searching to find a solution but as above, don't really know where to start.

Topic Closed

This topic has been closed to new replies.

About this Topic