How do i set up multiple portfolios (each with its own defined set of images -) to display on the same page?

Generally speaking this should produce the structure you’re looking for. It’s 4 separate WP_query loops, and each loop pulls in posts from the category named. <div id=”portfolio”> <div class=”col”> <?php $cat1 = new WP_query(array(‘category_name’ => ‘design’)); if($cat1->have_posts()) : while($cat1->have_posts()) : $cat1->the_post(); ?> <div class=”item”> <?php if(has_post_thumbnail()) { the_post_thumbnail(); } ?> </div> <?php endwhile; endif; ?> … Read more

Show subcategories and hide posts or show posts if not exists subcategories

I would use a combination of get_categories and get_category_children to achieve this. For example: On the home page include something like this: <?php $args=array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’ ); $categories=get_categories($args); foreach($categories as $category) { $catChildren = get_term_by($category->ID, ‘category’); if(!empty($catChildren)) { echo ‘<h3><a href=www.yourwebsite.com/”‘ . $category->slug . ‘”>’ . $category->name . ‘</h3>’; } } … Read more

Add Category Descriptions to Montezuma Theme

The WordPress template hierarchy indicates that index.php is the template used, if category.php and archive.php are missing. So, you can insert your code in index.php, and wrap it in a is_category conditional to make sure it’s only executed when a category archive is being displayed: <?php if( is_category() ) { // category description } ?>

Trying to WP_Query a category

You are using WP_Query incorrectly: you need to be calling the have_posts() and the_post() functions as methods of your $query variable: <?php if (have_posts()) : while (have_posts()) : the_post(); ?> Becomes: <?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?> You should also call wp_reset_postdata(); after the query loop is finished. … Read more

One color to category link depending on category ID

Open the page which is rendering the category posts, and in the appropriate place (before running the loop) write the following code <?php $catid = get_cat_id(); $color = “#222”; //default; if ($catid == $pinkCategoryId) $color = “#8B0A50”; else if ($catid == $redCategoryId) $color = “#FF0000″; ?> <style type=”text/css”> a { color: <?php echo $color;?>; } … Read more

Link to page in category

After a long search on the Web, I decided to take a look at the plugins @anjum sent, and found out this can be done through: <a href=”https://wordpress.stackexchange.com/questions/110906/<?php get_pagenum_link($i); ?>”>Link to page $i</a>