how to add tags to post in the Loop?

I found the issue was with the polylang plugin. For the above to work I needed to add the language info and in particular associated the tag with the language of the post. $result=wp_insert_term($tag, ‘post_tag’); pll_set_term_language($result[“term_id”], ‘fr’); pll_set_term_language is the function provided by the polylang plugin for associating the newly added tag with the language … Read more

WordPress Post 403 Error Based on Slug

I figure it out. I’m an idiot. I have image folders on my server that were an exact match as the post’s slug. In the above case, I have a image folder named adam-baldwin which causes a conflict in Apache. Once I changed the slug, the conflict resolved itself.

Target only single product page

I assume you mean to use this on a single product’s page, right? If so, try this: add_action(‘admin_head’, ‘wwc_my_custom_css’); function wwc_my_custom_css() { if (!current_user_can(‘edit_pages’){ global $post; $isProduct = $post->post_type == ‘product’; // use the actual name for product if ($isProduct ) { echo ‘<style> #mceu_27-body, #wp-content-editor-tools{ display:none !important; } </style>’; } } }

How to allow WordPress to recognize a custom URL segment after a product URL and use a custom template?

Looks like all I needed to do was put the template_include filter inside of the init action. Source: https://stackoverflow.com/a/50037707/5749974 add_action( ‘init’, function () { $product_base = ltrim( get_option( ‘woocommerce_permalinks’ )[ ‘product_base’ ], “https://wordpress.stackexchange.com/” ); add_rewrite_rule( “{$product_base}/([^/]+)/test”, ‘index.php?product=$matches[1]&test=1’, ‘top’ ); add_filter( ‘template_include’, function( $template ) { if ( get_query_var( ‘test’ ) ) { $template = get_stylesheet_directory() … Read more