PHP Wordpress help

Soldato
Joined
29 Dec 2004
Posts
5,653
Location
Chatham, Kent
Code:
<?php if ( get_option('arras_featured_cat') != '' ) : ?>
    <!-- Featured Articles -->
    <div class="featured clearfix">
    <?php query_posts('showposts=40&cat=' . get_option('arras_featured_cat') ); ?> 
        <div id="controls" style="display: none;">
            <a href="" id="prev">Prev</a>
            <a href="" id="next">Next</a>
        </div>
        <div id="featured-slideshow">
            <?php $count = 0; ?>
            <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
            <div <?php if ($count != 0) echo 'style="display: none"'; ?>>
                <a class="featured-article" href="<?php the_permalink(); ?>" rel="bookmark" style="background: url(<?php echo arras_get_thumbnail('large'); ?>) no-repeat;">
                <span class="featured-article-content">
                    <span class="title"><?php the_title(); ?></span>
                    <?php if ( get_option('arras_display_preview_type') == '' || get_option('arras_display_preview_type') == 'content' ) : ?>
                    <span><?php the_content_rss('', TRUE, '', 25, 2); ?></span>
                    <?php else : ?>
                    <span><?php the_excerpt(); ?></span>
                    <?php endif; ?>
                </span>
                </a>
            </div>
            <?php $count++; endwhile; endif; ?>
        </div>
    </div>
<?php endif; ?>

</div>
    <?php 
    $allowed_cats = get_option('arras_gaming_platform_cats');
    if ( get_option('arras_news_order') == '' || get_option('arras_news_order') == 'date' ) :
    ?>
    
        <?php wp_reset_query(); query_posts('cat=' . get_option('arras_news_cat')); ?>
        <?php if (have_posts()) : ?>
        <ul class="posts clearfix">
        <?php while (have_posts()) : the_post(); ?>    
                <?php $thumbnail = get_post_meta($post->ID, 'thumb', true); ?>
                    <li class="clearfix">
                        <a href="<?php the_permalink(); ?>">
                        <img src="<?php echo arras_get_thumbnail(); ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" /> 
                        </a>
                        <h2><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
                        <?php if ( get_option('arras_display_preview_type') == '' || get_option('arras_display_preview_type') == 'content' ) : ?>
                        <div><?php the_content_rss('', TRUE, '', 20, 2); ?></div>
                        <?php else : ?>
                        <div><?php the_excerpt(); ?></div>
                        <?php endif; ?>
                    </li>
        <?php endwhile; ?>
        </ul>
        <?php endif; ?>
    
    <?php else : ?>
    
           <?php
        foreach ( $allowed_cats as $cat ) :
        //wp_reset_query(); query_posts('cat=' . $cat . ',' . get_option('arras_news_cat') . '&showposts=' . $limit);
        wp_reset_query(); 
        query_posts( array(
            'category__and' => array( $cat, get_option('arras_news_cat') ),
            'showposts' => 1
        ) );                
        if (have_posts()) :
        ?>
        <div class="percat clearfix">
        <div class="category"><?php echo get_cat_name($cat); ?></div>
        <ul class="posts clearfix">
        <?php while (have_posts()) : the_post(); ?>    
            <?php $thumbnail = get_post_meta($post->ID, 'thumb', true); ?>
            <li class="clearfix">
                <a href="<?php the_permalink(); ?>">
                    <img src="<?php echo arras_get_thumbnail(); ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
                </a>
                    <h2><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
                <div><?php the_content_rss('', TRUE, '', 20, 2); ?></div>
            </li>
        <?php endwhile; ?>
        </ul></div>
    <div class="module clearfix">
  <h2 align="center">Search our Website</h2>
        <div style="margin: 5px 0 10px; text-align: center">
            <?php include TEMPLATEPATH . '/searchform.php'; ?>
        </div>
    </div>
    
    <div id="bottom-content">
        <ul class="clearfix">
            <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Bottom Content') ) : ?>
            <li>
                <a class="see-all-link" href="<?php echo get_category_link(get_option('arras_reviews_cat')); ?>">See All</a>
                <h2>Latest Reviews</h2>
                <?php $reviews = get_posts('numberposts=20&category=' . get_option('arras_reviews_cat')); ?>
                <?php if ($reviews) : ?>
                <ul>
                <?php foreach ( $reviews as $post ) : ?>
                     <li>
                         <span class="platform-sub">
                        <?php $cats = get_the_category(); foreach ( $cats as $cat ) : ?>
                            <?php if ( is_array($allowed_cats) && in_array($cat->cat_ID, $allowed_cats) ) echo strtoupper($cat->category_nicename); ?>
                        <?php endforeach; ?>
                        </span>
                         <strong><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></strong>
                     </li>
                <?php endforeach; ?>
                </ul>
                <?php else : ?>
                <p class="textCenter sub">No posts at the moment. Check back again later!</p>
                <?php endif; ?>   
            </li>
            <li>
                <a class="see-all-link" href="<?php echo get_category_link(get_option('arras_previews_cat')); ?>">See All</a>
                <h2>Latest Previews</h2>
                <?php $previews = get_posts('numberposts=20&category=' . get_option('arras_previews_cat')); ?>
                <?php if ($previews) : ?>
                <ul>
                <?php foreach ( $previews as $post ) : ?>
                     <li>
                         <span class="platform-sub">
                        <?php $cats = get_the_category(); foreach ( $cats as $cat ) : ?>
                            <?php if ( is_array($allowed_cats) && in_array($cat->cat_ID, $allowed_cats) ) echo strtoupper($cat->category_nicename); ?>
                        <?php endforeach; ?>
                        </span>
                         <strong><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></strong>
                     </li>
                <?php endforeach; ?>
                </ul>
                <?php else : ?>
                <p class="textCenter sub">No posts at the moment. Check back again later!</p>
                <?php endif; ?> 
            </li>
            <?php endif; ?>
        </ul>
        </div>

www.eteknix.com

Anyone know why my page has gone funny, the code for that page is above.

Thanks,

Andy
 
Last edited:
Back
Top Bottom