How to show video from wp option value?

Your code: $cat_data = get_option(“category_$cat_id”); if ( isset($cat_data[‘extra1’] ) ){ echo do_shortcode(‘[videojs youtube=”‘.$cat_meta[‘extra1′].'” width=”699″ height=”269″ preload=”auto” loop=”true” autoplay=”false” controls=”false” class=”responsive-video”]’); } There’s a number of things you’re not doing or could do better here: You never check if the option exists, if get_option doesn’t find anything and returns a value of false your code may … Read more

How to display category list with category description

Use this instead of wp_list_categories( $args ); wp_list_categories( $args ); It will display the category with formatted results like <ul><li> $categories = get_the_category(); This will returns the all category assigns to the current post and store in $category variable. Then you can display as in you listed format $page_custom_image = get_field(“your_custom_field_name”, “texonomyname_” .$category->term_id);

Woocommerce – Display product category of product in Orders page

Add Below Code in Your Theme function.php function action_woocommerce_admin_order_item_headers( ) { ?> <th class=”item sortable” colspan=”2″ data-sort=”string-ins”><?php _e( ‘Item category’, ‘woocommerce’ ); ?></th> <?php }; // define the woocommerce_admin_order_item_values callback function action_woocommerce_admin_order_item_values( $_product, $item, $item_id ) { ?> <td class=”name” colspan=”2″ > <?php $termsp = get_the_terms( $_product->id, ‘product_cat’ ); if(!empty($termsp)){ foreach ($termsp as $term) { … Read more

All post of child category not in top category

Maybe something like this would do? $cat=”About us”; $tax = ‘category’; $cat_id = get_cat_ID($cat); $category = get_term_children($cat_id, $tax); $pre=””; foreach ($category as $sub) { $cat_list .= $pre . $sub; $pre=”, “; } query_posts(array( ‘cat’ => $cat_list, ‘posts_per_page’ => 1000)); echo ‘<ul>’; while ( have_posts() ) : the_post(); echo ‘<li>’; the_title(); echo ‘</li>’; endwhile; echo ‘</ul>’;

How to get Woocomerce categories count

If anyone needs it $args = array( ‘type’ => ‘product’, ‘parent’ => get_queried_object_id(), ‘orderby’ => ‘term_group’, ‘hide_empty’ => true, ‘hierarchical’ => 1, ‘taxonomy’ => ‘product_cat’, ‘pad_counts’ => false ); $cats = get_categories( $args ); print_r(count($cats));

Update wordpress menu with woocommerce products

EDIT: I tried the following and it works in the theme “Storefront for woocommerce”(Though it needs additional styling). For some reason though, it does not work well with the twentyfifteen theme.(The submenu does not show.) add_filter( ‘wp_nav_menu_items’, ‘wc_products_on_nav_menu’); //filter to add the html add_action( ‘save_post_product’, ‘rebuild_custom_wc_nav_menu’); //action to regenerate the menu array anytime a product … Read more

Echo Category In Loop

The function get_theme_mod() returns information. Since you want to assign it and not echo it to the screen, we can remove the echo and PHP tags: $args = array( ‘post_type’ => ‘product’, ‘stock’ => 1, ‘posts_per_page’ => 4, ‘product_cat’ => get_theme_mod( ‘vatname’, ‘Clothing’ ), ‘orderby’ =>’date’, ‘order’ => ‘ASC’ ); That should fix your query. … Read more

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