How to Show Specific tags which start checklist- in product page in woocommerce wordpress

I want to show these tags in products page which start with the checklist- (in WordPress woo-commerce)

Kindly provide mw the code, I will replace with this code

get_id(), ‘, ‘, ” . _n( ‘Tag:’, ‘Tags:’, count( $ product->get_tag_ids() ), ‘woocommerce’ ) . ‘ ‘, ” ); ?>

Add product to cart with hook, discount applies after refresh of page

I have this simple setup where I add a product to the cart as a gift if conditions are met like so:

add_action( 'woocommerce_before_cart', 'apply_membership_benefits' ); function apply_membership_benefits() {   global $  woocommerce;              // Get the cart subtotal in non-decimal number format   $  cart_subtotal = WC()->cart->subtotal;   $  product_id1 = 9617; // membership product       $  product_id2 = 9616; //  custom bottle product          // If cart subtotal is less than 800 remove benefits   if ($  cart_subtotal < 800) {       WC()->cart->remove_cart_item( WC()->cart->generate_cart_id( $  product_id1 ) );       WC()->cart->remove_cart_item( WC()->cart->generate_cart_id( $  product_id2 ) );   }       // If cart above 800 add membership benefits   if ($  cart_subtotal > 799 ) {            $  item_key_inc_cart = WC()->cart->add_to_cart( $  product_id1 );     WC()->cart->set_quantity( $  item_key_inc_cart,1 );            $  item_key_inc_cart = WC()->cart->add_to_cart( $  product_id2 );     WC()->cart->set_quantity( $  item_key_inc_cart,1 );          }  } 

The cart will work correctly only I also have a discount plugin that also applies a discount to this cart of 20%. The problem is the discount is applied if the user is refreshing the page so the cart content seems to be read before the woocommerce_before_cart hook.

Consequently if I remove one product from the cart adn the subtotal will be below 800 as shown in the example the gifts will be removed but the discount is still applied and needs a page refresh to be recalculated and eventually removed.

The discount plugin seems to add all the necessary data with these hooks

    // Prepare cart discounts     add_action('woocommerce_before_calculate_totals', array($  this, 'prepare_cart_discounts'), 1);      // Apply cart discounts     add_action('woocommerce_after_calculate_totals', array($  this, 'apply'));      // Remove no longer applicable cart discounts     add_action('woocommerce_before_calculate_totals', array($  this, 'remove_cart_discounts'), 2);     add_action('woocommerce_check_cart_items', array($  this, 'remove_cart_discounts'), 1);      // Invalidate no longer applicable cart discounts     add_filter('woocommerce_coupon_is_valid', array($  this, 'maybe_invalidate_cart_discount'), 10, 2);      // Register custom coupon type     add_filter('woocommerce_coupon_discount_types', array($  this, 'register_custom_coupon_type')); 

Custom Page out of Wp Theme

i have this website running in WP and I had to create a feature to generate pages automatically and I did it through a separate WP backend, which creates the .php pages within the root of the site.

When I call domain/slug-of-page.php everything is ok.

But when I call the page without the extension (.php) the WP understands that it is an invalid url (404 error) because there is no page in the WP with that name.

I tried to insert the page created in the wp_posts table but when calling the page it loads the WP theme … I don’t want it to load the theme.

Is there a way to make the url friendly (without the extension) and not handled by the WP handler?

Thanks for every help.

Include page name in posts slug

I have created a custom page template with option to select a tag from posts Categories to query the respective posts with that tag when the page is opened.

Page with name Trips are created, custom template selected and also category tag Trips is selected.

Page is then added to the menu under About Us menu item.

When I open the page site.com/about-us/trips/ A custom template are loaded with all the posts with term Trips.

When I open the post, the URL of the post is site.com/trips/post-slug where "trips" are the category tag slug.

Is there any option for those posts to include their "parent" page slugs like in this example it would be site.com/about-us/trips/post-slug ?
I could set the category base as ‘about-us’, but that is not a solution because there could be multiple pages with that custom template and another category tag selected f.e. site.com/about-us/interviews/post-slug

I am sorry, I have no code example for what I have done so far as I dont even know where to start 🙂

Use XML Based Sitemap and/or Static Page Sitemap?

I have a question about which sitemap to use – XML based that is sent to Google Search Console or static HTML based sitemap that is added to the website footer.

If you search "dump trucks for sale", you will find this result in the third position: https://www.commercialtrucktrader.com/Dump/trucks-for-sale?category=Dump%20Truck%7C2000609

Our website uses faceted navigation to filter inventory results, like the Commercial Truck Trader website example I posted regarding a search query.

I see the Commercial Truck Trader website has a sitemap link added to their footer. This is a static HTML based sitemap that can help the user navigate parts of the website.

Do you think the search query "dump trucks for sale" is showing the Commercial Truck Trader website in the third position on a serp from using a static HTML based sitemap that is added to the website footer, or from an XML based sitemap that is sent to Google?

WordPress Sub Category Archive, Show Extra Empty Page Number in Pagination

This my code for sub category archive page:

                        <?php $  my_query = new WP_Query( array( 'posts_per_page' => 12, 'post_type' => 'post', 'paged' => get_query_var( 'paged' ), 'post_status' => 'publish', 'category__and' => array( 2 ) ) ); ?>                                 <?php if ($  my_query->have_posts()) : ?>                         <?php while ($  my_query->have_posts()) : $  my_query->the_post(); ?>                          //Contents Here//                          <?php endwhile; ?><?php endif; ?>                                            <?php wp_reset_postdata(); ?> 

Now I have 1 empty extra page number in pagination of my archive page.

For example I have only 3 pages of contents by I can See a number 4 link in pagination numbers who open’s an empty page without any posts in there.

Can you help me please?

Custom Post Type Archive Page URL

I created a custom post type called provider, and currently I have a URL structure like so:

  1. .com/provider/abc
  2. .com/provider/xyz
  3. etc…

Now I would like to add some content in the provider page, mostly for SEO reasons. After having a look at how archive pages are working, I found out that it would be best to just change the URL of the archive page for provider. So the new URL would be .com/provider-archive/ while keeping the same URL for the provider already in the system, so they would remain:

  1. .com/provider/abc
  2. .com/provider/xyz
  3. etc…

This way, I would be able to create a regular page and give it the /provider/ URL.

I am trying to do so by changing the rewrite, adding in a slug to be provider-archive. After doing all of this, and creating a new page with the URL /provider/, when I try to access said URL I still see the archive.

This is how my custom post type is set up:

/**  * Register Provider Meta Box  */  add_action('init', 'cpt_provider'); function cpt_provider() {      $  labels = array(         'name'               => _x('Providers', 'post type general name', 'mebo-cpt'),         'singular_name'      => _x('Provider', 'post type singular name', 'mebo-cpt'),         'menu_name'          => _x('Providers', 'admin menu', 'mebo-cpt'),         'name_admin_bar'     => _x('Provider', 'add new on admin bar', 'mebo-cpt'),         'add_new'            => _x('Add New', 'book', 'mebo-cpt'),         'add_new_item'       => __('Add New Provider', 'mebo-cpt'),         'new_item'           => __('New Provider', 'mebo-cpt'),         'edit_item'          => __('Edit Provider', 'mebo-cpt'),         'view_item'          => __('View Provider', 'mebo-cpt'),         'all_items'          => __('All Providers', 'mebo-cpt'),         'search_items'       => __('Search Providers', 'mebo-cpt'),         'parent_item_colon'  => __('Parent Providers:', 'mebo-cpt'),         'not_found'          => __('No Providers found.', 'mebo-cpt'),         'not_found_in_trash' => __('No Providers found in Trash.', 'mebo-cpt')     );      $  args = array(         'labels'             => $  labels,         'description'        => __('Description.', 'mebo-cpt'),         'public'             => true,         'publicly_queryable' => true,         'show_ui'            => true,         'show_in_menu'       => true,         'query_var'          => true,         'capability_type'    => 'post',         'rewrite'           => array( 'slug' => 'provider-archive' ),         'hierarchical'       => true,         'menu_position'      => null,         'menu_icon'          => get_template_directory_uri() . '/img/icons/Gun-512.png',         'supports'           => array('title', 'editor')     );      register_post_type('provider', $  args); } 

Is there anything that I’m missing?

Is the same page tool overkill for brand new players?

I’m about to run the D&D 5e starter set for a group, most of which are entirely new to RPGs. The Same Page Tool looks like a great resource for a new group playing together, but not necessarily for brand new players getting familiar with the game, the setting, their character, the rules all for the first time.

Is it better to skip the same page tool for the first few sessions to allow people to get used to the game rather than overload them with information?

How do I prevent the page from rendering the header seconds before the content?

Dealing with a rough issue here. Currently have no site optimization configured (that I am aware of) but for all pages on the site, the header loads a significant amount of time before the rest of the page content. This is causing a large issue with CLS on Google, as the page shifts when the body of the page is rendered. Is there any way that I can enforce them to load at the same time? This only became an issue recently.