• Resolved CrimsonMoon

    (@crimsonmoon)


    Hello,

    I am running a child theme of WPEX Elegant free theme, and I want to have 5 feature items on one row on the homepage. The default setting is to have 4 feature items on the row, and then reset to a new row. I can’t seem to get the feature article class to change to the 5-column setting, “span_1_of_5 col clr”.

    I checked the style.css and there seems to be support for a 5-column grid:

    .span_5_of_5{width:100%}.span_4_of_5{width:79.68%}.span_3_of_5{width:59.36%}.span_2_of_5{width:39.04%}.span_1_of_5{width:18.72%}

    The feature code for home.php is:

    /**
    						Features
    					**/
    					$wpex_query = new WP_Query(
    						array(
    							'order'				=> 'ASC',
    							'orderby'			=> 'menu_order',
    							'post_type'			=> 'features',
    							'posts_per_page'	=> '-1',
    							'no_found_rows'		=> true,
    						)
    					);
    					if ( $wpex_query->posts ) { ?>
    						<div id="homepage-features" class="clr">
    							<?php $wpex_count=0; ?>
    							<?php foreach( $wpex_query->posts as $post ) : setup_postdata( $post ); ?>
    								<?php $wpex_count++; ?>
    									<?php get_template_part( 'content-features', get_post_format() ); ?>
    								<?php if ( $wpex_count == '4' ) { ?>
    									<?php $wpex_count=0; ?>
    								<?php } ?>
    							<?php endforeach; ?>
    						</div><!-- #homepage-features -->
    					<?php } ?>

    I changed the reset count to 5, but that only floats the 5th item to the right rather than the left:

    <?php if ( $wpex_count == '5' ) { ?>
    									<?php $wpex_count=0; ?>
    								<?php } ?>

    I also tried changing the features code in post-classes.php to be a 5-column span, but the feature article classes still say “span_1_of_4 col clr”:

    // Features
    		if ( $post_type == 'features' ) {
    			$classes[] = 'span_1_of_5 col clr';
    		}

    How do I make the article class change to “span_1_of_5 col clr”?

    Thanks!

Viewing 1 replies (of 1 total)
  • Thread Starter CrimsonMoon

    (@crimsonmoon)

    Okay, I figured it out. I went into content-features.php and edited it to say:

    <article id="id-<?php the_ID(); ?>" <?php post_class( 'span_1_of_5' ); ?>>

Viewing 1 replies (of 1 total)
  • The topic ‘[Theme: WPEX Elegant] Feature Columns’ is closed to new replies.