A to Z List of Custom Post Type in three columns

The problem lies in this line: $rows[$count] = $rows[$count] . ‘<div class=”col-sm-3″>’ . ‘<h4>’.strtoupper(get_the_title()[0]).'</h4>’ .'<div class=”post-title”>’. ‘<li><a href=”‘.get_permalink().'”>’.get_the_title().'</a></li>’ . ‘</div></div>’; As I understand your code correctly, it should append another column item to given row. But it doesn’t do it – it overwrites the content of given row with current column. So it should look … Read more

Display the last post by each category?

Try this <?php $post_type = “post”; $taxonomy = “category”; $terms = get_terms( array( ‘taxonomy’ => $taxonomy, ‘hide_empty’ => 0, ‘hierarchical’=> 1, ) ); echo ‘<ul>’; foreach($terms as $term): $term_id = $term->term_id; $term_name = $term->name; $query = array( ‘post_type’ => $post_type, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 1, ); $query[‘tax_query’] = array( array( ‘taxonomy’ => $taxonomy, ‘terms’ … Read more

How to enumerate a list of posts?

I am not sure what your loop looks like from which you are adding the articles to your list. All you need do is to create a variable to hold your counter somewhere before the while statement in your loop. This could be something like <?php $counter = 0; ?> Note I am setting the … Read more

How to divide and display categories into two columns

You don’t need any code changes to your PHP or html! Assuming the following code was used: <ul class=”mypagelist”> <?php wp_list_pages(‘sort_column=menu_order&title_li=’); ?> </ul> Resulting in: <ul class=”mypagelist”> <li>Page 1</li> <li>Page 2</li> <li>Page 3</li> <li>Page 4 <ul> <li>Subpage 1</li> </ul> </li> <li>Page 5</li> </ul> Use CSS along the following lines: .mypagelist { width:600px; /* or any … Read more

custom walker wp menu last element

If you can live without re-creating the menu walker, you can add classes to menu items manually. On the WordPress menu editing screen, click on “Screen Options” and enable “CSS Classes.” Then you’ll be able to add whatever class you want to whichever list item. Creating a custom Walker for something like this will be … Read more

WooCommerce Grid / List view

Undo any changes you’ve have made to the file, then add this at the top: if ( jQuery.cookie( “gridcookie” ) != “grid” ) { jQuery.cookie( “gridcookie”, “list”, { path: “https://wordpress.stackexchange.com/” } ); } Update: Sounds like a FOUC. Let’s take a different approach – remove the code you added above & try adding the following … Read more

Show Available Taxonomy List with Current Category

I’m not hundred percent sure but I think the widget in scribu’s plugin, Query Multiple Taxonomies, works exactly as you described. You can find plenty of resources on the subject on his blog. This plugin lets you do faceted search using multiple custom taxonomies. It has a drill-down widget with multiple display modes. Said widget … Read more

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