How can I create a loop to build slides based on multiple categories using Coda Slider

For those who were interested in an answer to this question, I found the answer myself. <div class=”coda-slider” id=”slideshow”> <?php // array of category IDs $categories = array(1,2,3,4,5); foreach ($categories as $cat) : $post = false; $post = get_posts(‘cat=”.$cat.”&posts_per_page=1’); if($post) : $post = $post[0]; setup_postdata($post); ?> <!– rest of normal loop –> <div <?php post_class(); … Read more

Rewrite category slug

It can be done by writing a code on post_link filter. This filter allows you to change the final post link. Since you are showing categories in your permalink, so I am assuming that your permalink structure contains %category% in it. Below code will help you to get links the way you want. add_filter( ‘post_link’, … Read more

Excluding a category from next and previous post links

The next_post_link() and previous_post_link() functions have parameteres as follows – $format (string) – You’ve already included this. $link (string) – You’ve already included this. $in_same_term = false (boolean) – Whether or not all linked posts should be within the same taxonomy term. Chances are this should be false if you are looking to exclude a … Read more

List of subcategories with featured image

How can I add the featured image? From what I can tell in your code, you’ve stored all category featured images in the category_images option. So you can use get_option to retrieve the featured image for each category: $image_urls = get_option( ‘category_images’, array() ); foreach ( $categories as $category ) { $cat_id = $category->term_id; $image_url … Read more

Get child categories when clicking on parent category

Grab the parent category $category = get_category_by_slug( ‘category-name’ ); Set whatever args you need for your post query, but make sure to include the child_of arg $args = array( ‘type’ => ‘post’, ‘child_of’ => $category->term_id, ‘hierarchical’ => 1, ‘taxonomy’ => ‘category’, ); Get your subcategories based on these args $child_categories = get_categories($args); You’ll get an … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)