This is probably very easy to do, but unfortunately I'm not too good with coding. I am honestly trying to learn though.
I have a theme in wordpress that makes posts tagged with "spotlight" twice the size of the rest. I would like to change this so that it's automatically the first post that is this size. I hope that makes sense.
A snippet of the code I have:
// Get blog layout setting
$blog_layout = get_theme_mod( 'blog_layout_setting', 'three-columns' );
$portfolio_layout = get_theme_mod( 'portfolio_layout_setting', 'four-columns' );
if ( is_tax( 'ct_portfolio' ) || is_page_template( 'templates/template-portfolio.php' ) ) :
if ( 'four-columns' == $portfolio_layout ) {
if ( has_tag( 'spotlight' ) ) {
$classes[] = 'col-lg-6 col-md-8 col-sm-12';
} else {
$classes[] = 'col-lg-3 col-md-4 col-sm-6';
}
} else {
if ( has_tag( 'spotlight' ) ) {
$classes[] = 'col-md-8 col-sm-12';
} else {
$classes[] = 'col-md-4 col-sm-6';
}
}
I'm pretty sure it's just to change the "if ( has_tag( 'spotlight' )" to something i++ or i=1, or something like that. I might also be completely wrong. I feel like the answer is staring me in the face, but I just can't grasp it. I've tried searching around, but haven't found a good answer.
I would be really happy for any help, and I really do learn from this.
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire