Created
December 15, 2014 15:21
-
-
Save mahodder/472fd0ed83a48904a94c to your computer and use it in GitHub Desktop.
Change Order of Tags to DESC / Grind & Genesis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove_action('genesis_before_footer', 'themedy_homepage', 1); | |
add_action('genesis_before_footer', 'custom_themedy_homepage', 1); | |
function custom_themedy_homepage() { | |
?> | |
<?php if ( is_active_sidebar('section-one-col-1') || is_active_sidebar('section-one-col-2') || is_active_sidebar('section-one-col-3') || is_active_sidebar('section-one-row') ) { ?> | |
<div id="section-1" class="section"> | |
<div class="wrap"> | |
<?php dynamic_sidebar('section-one-row'); ?> | |
<?php if ( is_active_sidebar('section-one-col-1') || is_active_sidebar('section-one-col-2') || is_active_sidebar('section-one-col-3') ) { ?> | |
<div class="section-columns"> | |
<div class="homepage-col one-third first"> | |
<?php dynamic_sidebar('section-one-col-1'); ?> | |
</div> | |
<div class="homepage-col one-third"> | |
<?php dynamic_sidebar('section-one-col-2'); ?> | |
</div> | |
<div class="homepage-col one-third"> | |
<?php dynamic_sidebar('section-one-col-3'); ?> | |
</div> | |
</div> | |
<?php } ?> | |
</div> | |
</div> | |
<?php } ?> | |
<?php if (themedy_get_option('portfolio_section')) { ?> | |
<div id="portfolio-area" class="section"> | |
<div class="wrap"> | |
<div class="homepage-row"> | |
<h2 class="widgettitle"><?php echo esc_attr(themedy_get_option('portfolio_title')); ?></h2> | |
<div id="portfolio-controls"> | |
<ul> | |
<li class="selected"><a href="#" data-value="all"><?php _e('All','themedy'); ?></a></li> | |
<?php | |
$terms = get_terms( 'portfolio-category', array( | |
'orderby' => 'name', | |
'order' => 'DESC', | |
'hide_empty' => 1 | |
) ); | |
if ($terms) foreach ( $terms as $term ) { | |
?> | |
<li class=""><a href="#" data-value="<?php echo $term->slug; ?>"><?php echo $term->name; ?></a></li> | |
<?php | |
} | |
?> | |
</ul> | |
</div> | |
</div> | |
<div id="portfolio-items"> | |
<ul id="portfolio-grid" class="portfolio-grid"> | |
<?php | |
query_posts( array ('post_type' => 'portfolio', 'showposts' => themedy_get_option('portfolio_limit') ) ); | |
global $post; | |
$i = 1; | |
if ( have_posts() ) : while ( have_posts() ) : the_post(); | |
$terms = get_the_terms( $post->ID, 'portfolio-category' ); | |
?> | |
<li data-id="id-<?php echo $i; $i++; ?>" class="<?php if ($terms) foreach ( $terms as $term ) { echo $term->slug.' '; } ?>"> | |
<?php | |
if (genesis_get_image()) { | |
$img = genesis_get_image( array( 'format' => 'html', 'size' => 'alternate-portfolio-thumbnail' ) ); | |
} else { | |
$img = '<img src="'.CHILD_URL.'/images/noimage265x200.png" alt="" />'; | |
} | |
printf( '<a href="%s" class="thumb" title="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), $img ); | |
?> | |
</li> | |
<?php endwhile; else: endif; wp_reset_query(); ?> | |
</ul> | |
</div> | |
</div> | |
</div> | |
<?php } ?> | |
<?php if ( is_active_sidebar('section-three-col-1') || is_active_sidebar('section-three-col-2') || is_active_sidebar('section-three-col-3') || is_active_sidebar('section-three-col-4') || is_active_sidebar('section-three-row') ) { ?> | |
<div id="section-3" class="section"> | |
<div class="wrap"> | |
<?php dynamic_sidebar('section-three-row'); ?> | |
<?php if ( is_active_sidebar('section-three-col-1') || is_active_sidebar('section-three-col-2') || is_active_sidebar('section-three-col-3') || is_active_sidebar('section-three-col-4') ) { ?> | |
<div class="section-columns"> | |
<div class="homepage-col one-fourth first"> | |
<?php dynamic_sidebar('section-three-col-1'); ?> | |
</div> | |
<div class="homepage-col one-fourth"> | |
<?php dynamic_sidebar('section-three-col-2'); ?> | |
</div> | |
<div class="homepage-col one-fourth"> | |
<?php dynamic_sidebar('section-three-col-3'); ?> | |
</div> | |
<div class="homepage-col one-fourth"> | |
<?php dynamic_sidebar('section-three-col-4'); ?> | |
</div> | |
</div> | |
<?php } ?> | |
</div> | |
</div> | |
<?php } ?> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment