Show Primary Category first when I display post categories

Assuming you are using Yoast SEO plugin – I haven’t tested this, but I think you can do something like this: (Source https://pretagteam.com/question/get-primary-category-if-more-than-one-is-selected) /* Checks for a yoast primary category, if it exists move the category to the first position in the $categories array. */ function yoast_primary_cat_as_first_cat($categories) { // Check if yoast exists and get … Read more

How to put “Read more” link in Custom Excerpt inside p tag?

One approach is: //… // this is the resulted paragraph without the enclosing <p> and </p> $first_para_inner_text = $matches [1] [1]; // <– the index changed $link = get_permalink($post); // rebuilding the p $first_para=”<p>” . $first_para_inner_text . ‘ <a href=”‘.$link.'”>Read More</a></p>’; echo $first_para; Not tested, but you may get the idea. Just need to modify/change … Read more

How can I remove the main description text box in a Woocommerce product editor page? I only use the “Product short description” text box [closed]

I haven’t tested but something like this should work: function wpse70000_add_author_metabox_to_cpt_book( $args, $post_type ) { if (‘product’ === $post_type ){ unset($args[‘editor’] ); // set the ‘supports’ array } return $args; } add_filter( ‘register_post_type_args’, ‘wpse70000_add_author_metabox_to_cpt_book’, 10, 2 );