Media Library Categories

I found a solution! My code changed quite a bit… Here is what the functions.php file looks like (which did not change): function wptp_add_categories_to_attachments() { register_taxonomy_for_object_type( ‘category’, ‘attachment’ ); } add_action( ‘init’ , ‘wptp_add_categories_to_attachments’ ); But here is the new code in footer.php, which returns the images from the Media Library, but only from an … Read more

Hide empty category on woocommerce

By your code i’m assuming your $child is the id of an term, the term object is being stored in the $term variable, so you can do this: <?php if( $term->count > 0 ): ?> <li><a href=”https://wordpress.stackexchange.com/questions/274628/<?php echo get_term_link( $child,”product_cat’ )?>”><?php echo $term->name; ?></a></li> <?php endif; ?>

Post url rewriting for posts with certain category

generate_rewrite_rules didn’t work for me at all and I found posts on forums where others were having the same issue. Adding to the rewrite_rules_array did work. Below is the solution. add_filter( ‘post_link’, ‘custom_permalink’, 10, 3 ); add_filter(‘rewrite_rules_array’,’wp_insertMyRewriteRules’); add_filter(‘init’,’flushRules’); function custom_permalink( $permalink, $post, $leavename ) { $category = get_the_category($post->ID); if ( !empty($category) && $category[0]->cat_name == “Shop” … Read more

Default URL for category dropdown select option

I found a solution! As I was looking for a fix I ran across this article: https://andrux.net/add-empty-option-to-wp_dropdown_categories/ This is very close to what I was looking for, so I tweaked it. The only thing I did to the form was remove the show_option_none=Select… The form code: <form action=”<?php bloginfo(‘url’); ?>” method=”get” id=”catform”> <?php $parent = … Read more

Categorizing Just Imported Posts

For changing the category from Tumblr to another one for that you need to create another caregory at <pre> Posts -> Categories -> Add New </pre> first and than filter categories by Tumblr And than all Tumblr category’s Posts disaplay and do QUICK EDIT for changing the categories.