Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Glad to be of help 🙂

    Try this (assuming the id for the category is 20):

    <?php if ( in_category(20) ) { ?>
    <p>DO SOMETHING</p>
    <?php } else { ?>
    <p>DO SOMETHING ELSE</p>
    <?php } ?>

    with your code it would look like this:

    <?php if ( in_category(20) ) { ?>
    //do something
    <?php if (has_post_thumbnail( $post->ID ) ): ?>
    <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
    <div id="custom_bg">
    <img src="<?php echo $image[0]; ?>" />
    </div>
    <?php endif; ?>
    <?php } else { ?>
    //Do something else
    <?php } ?>

    Try disabling float:left for .middle_text_box_full p in css

    Seems to to the trick for me..

    Thread Starter DEKL1NE

    (@dekl1ne)

    Below is the loop I’m currently using for my page:

    <?php global $more;?>
    <?php
    global $wp_query;
    $query = new WP_Query( 'cat=15, 4' );
    $total_pages = $query->max_num_pages;
    if ($total_pages > 1){
    echo '<div id="pagination">';
      $current_page = max(1, get_query_var('paged'));
      echo paginate_links(array(
          'base' => get_pagenum_link(1) . '%_%',
          'format' => '?paged=%#%',
          'current' => $current_page,
          'total' => $total_pages,
        ));
    }
    echo '</div>'
    ?>
    <?php query_posts ($query_string . '&cat=15, 4'); ?>
    	<?php if ( have_posts() ) : ?>
        <?php while ( have_posts() ) : the_post(); ?>
        <ul id="cms-column" class="item">
          <li id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
            <div class="post-header">
               <h2><?php the_title(); ?></h2>
            </div><!--end post header-->
            <div class="entry clear">
                <?php if ( function_exists( 'add_theme_support' ) ) the_post_thumbnail('bigger_image'); ?>
                <div class="date"><?php the_time( 'j M y' ); ?></div>
    			<?php $more = 0;the_content(__('Read More ↓', 'TRUE')); ?>
                <?php edit_post_link(); ?>
                <?php wp_link_pages(); ?>
            </div><!--end entry-->
            <div class="post-footer">
            </div><!--end post footer-->
          	</li><!--end post-->
          </ul>
        <?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
        <div id="clear">
        </div>
        <?php else : ?>
        <?php endif; ?>

    [No bumping, thank you.]

Viewing 4 replies - 1 through 4 (of 4 total)