Getting values of a custom taxonomy dropdown

get_user_by() receives user data not taxonomy terms. Since you are not dealing with real userdata you’ll have to use get_term_by() to receive the term name. You would use it like this: $username = get_term_by( ‘id’, (int) $_POST[‘alt_comment_user’], ‘custom_authors’ ); Fixed code: function taxonomy_dropdown() { wp_dropdown_categories( array( ‘name’ => ‘alt_comment_user’, ‘taxonomy’ => ‘custom_authors’, ‘hide_empty’ => false … Read more

Category index featured image

What I did was; using the Taxonomy Images plugin to associate an image with each category, then to my theme’s header.php, below the <a> line in the above code; <?php $image_id = apply_filters( ‘taxonomy-images-queried-term-image-id’, 0 ); if ( is_category() && ! empty( $image_id )): print apply_filters( ‘taxonomy-images-queried-term-image’, ”, array( ‘image_size’ => ‘header’ ) ); else … Read more

WordPress Image Attachment using remote image

You’ll want to get very familiar with wp_insert_attachment(), download_url() and media_handle_sideload(). It’s a bit lengthy to get into the details here, but it absolutely can be done. I used these methods to create a media tab that allows a user to put in a vimeo/youtube URL which I store in a postmeta and use their … Read more

Archive links don’t work when clicked

OK. Here is your problem. wp_get_archives( $args ); … $args = array( ‘type’ => ‘monthly’, ‘limit’ => , ‘format’ => ‘html’, ‘before’ => , ‘after’ => , ‘show_post_count’ => false, ‘echo’ => 1 ); You are use wp_get_archives incorrectly. That function accepts particular ‘keys’, and cat isn’t one of them. You can use an array … Read more

All, published and pending order

Filter views_edit-post. function tst($a) { // var_dump(get_defined_vars()); $tst = array(); $tst[‘future’] = $a[‘future’]; $tst[‘publish’] = $a[‘publish’]; $tst[‘all’] = $a[‘all’]; return $tst; } add_filter(‘views_edit-post’,’tst’); You can juggle that new array however you want. The only keys that are present in the incoming array are the one that have posts so you should check that the key … 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