Woocommerce sale flash badge not showing in products page [closed]

the problem that I have is this. I am just helping someone with their woocommerce/wordpress website, I am not very experienced with it but they need some urgent help. Basically, they want to show a badge whenever a product is on sale. I just found the way to do it and it is working fine, but only in the single product page. In the page of a single product, in the related products it shows the badge in the discounted products. But in the general products page it does not show anything. This is the code I got for the single product pages:

function sales_badge( $  text, $  post, $  product ) {         return $  tagType = '<span class="onsale"><img style="max-width: 150px;" src="sale.jpg"></span>'; } add_filter('woocommerce_sale_flash', 'sales_badge', 99, 3 );  

For the theme we are using: Astra and Elementor. I have tried everything and in google but could not find anything related with this. FYI: we are not using any plugin for this and we do not plan to.

My website is showing today’s date instead of published date since db migration to a new wordpress

I exported my database and content to a new WordPress. Everything works fine, except that every post is showing under today’s date, instead of the published date like it should be (the actual published date is the good one in the dashboard though).

It was working correctly in my last WordPress (5.0.11). The new one is 5.6.1. Here’s the PHP related to the date in my theme :

<span class="post-date">     <?php     $  date = date_i18n( get_option( 'date_format' ), strtotime( get_the_date( 'r' ) ) );     printf( esc_html_x( 'Publié le %s', 'Publié le DATE', 'chosen' ), $  date );     ?> </span> 

Any idea what happened?

Data deleted with sqlplus still showing up in SQL Developer

I wrote a script to run with SQLPlus which deletes the previous seven days of data in my Oracle XE database. I logged into the database with SQLPlus, ran the script, and it showed me the correct rows had been deleted. I tried to query the same date range again just to make sure, and the query returned no results (i.e. the records were deleted).

However, when I then connect to the database using Oracle SQL Manager, I can go to the same table and all the data is still there! If I run the query in SQL Manager, it is then deleted from the table in SQL manager.

Anyone know why this is happening? The credentials I use to log in are the same in both instances and I’ve made sure to be logged out of SQL Manager when running SQLPlus and vice-versa. I’m running version 18c of XE database.

PAGE NOT SHOWING

I have a page that is not showing anymore its content on wordpress. The data and files are still here in my portfolios, but when I try to load the page a message appears:Oops. You have encountered an error The page was working fine until today. I’m not sure what happened. Plz can you help me fix this? Thank you

Custom post type not showing in xml sitemap

I create a custom post type in WordPress and it’s working. My issue is when I create my XML sitemap then I am getting my all the pages and post but not getting the custom post type.

Would you help me out with this?

// Register Custom Post Type blog function create_blog_cpt() {      $  labels = array(         'name' => _x( 'blogs', 'Post Type General Name', 'bloglist' ),         'singular_name' => _x( 'blog', 'Post Type Singular Name', 'bloglist' ),         'menu_name' => _x( 'blogs', 'Admin Menu text', 'bloglist' ),         'name_admin_bar' => _x( 'blog', 'Add New on Toolbar', 'bloglist' ),         'archives' => __( 'blog Archives', 'bloglist' ),         'attributes' => __( 'blog Attributes', 'bloglist' ),         'parent_item_colon' => __( 'Parent blog:', 'bloglist' ),         'all_items' => __( 'All blogs', 'bloglist' ),         'add_new_item' => __( 'Add New blog', 'bloglist' ),         'add_new' => __( 'Add New', 'bloglist' ),         'new_item' => __( 'New blog', 'bloglist' ),         'edit_item' => __( 'Edit blog', 'bloglist' ),         'update_item' => __( 'Update blog', 'bloglist' ),         'view_item' => __( 'View blog', 'bloglist' ),         'view_items' => __( 'View blogs', 'bloglist' ),         'search_items' => __( 'Search blog', 'bloglist' ),         'not_found' => __( 'Not found', 'bloglist' ),         'not_found_in_trash' => __( 'Not found in Trash', 'bloglist' ),         'featured_image' => __( 'Featured Image', 'bloglist' ),         'set_featured_image' => __( 'Set featured image', 'bloglist' ),         'remove_featured_image' => __( 'Remove featured image', 'bloglist' ),         'use_featured_image' => __( 'Use as featured image', 'bloglist' ),         'insert_into_item' => __( 'Insert into blog', 'bloglist' ),         'uploaded_to_this_item' => __( 'Uploaded to this blog', 'bloglist' ),         'items_list' => __( 'blogs list', 'bloglist' ),         'items_list_navigation' => __( 'blogs list navigation', 'bloglist' ),         'filter_items_list' => __( 'Filter blogs list', 'bloglist' ),     );     $  args = array(         'label' => __( 'blog', 'bloglist' ),         'description' => __( '', 'bloglist' ),         'labels' => $  labels,         'menu_icon' => 'dashicons-admin-comments',         'supports' => array('title', 'editor', 'thumbnail', 'custom-fields'),         'taxonomies' => array(),         'public' => true,         'show_ui' => true,         'show_in_menu' => true,         'menu_position' => 5,         'show_in_admin_bar' => true,         'show_in_nav_menus' => true,         'can_export' => true,         'has_archive' => true,         'hierarchical' => false,         'exclude_from_search' => true,         'show_in_rest' => true,         'publicly_queryable' => true,         'capability_type' => 'post',     );     register_post_type( 'blog', $  args );  } add_action( 'init', 'create_blog_cpt', 0 ); 

Displaying all posts by category and showing content on click

I am building a WordPress site for a composer who has written over 200 pieces of music. Each is a custom post (work), organised by a hierarchical custom taxonomy/category (type – being orchestral, vocal, etc).

I need to build a catalogue page in which all works are displayed in lists by type:

Orchestral Works:

  • Work
  • Work

Vocal Works:

  • Work
  • Work

etc.

The user can add categories to the list, so I can’t simply write a query for each category. The catalogue page needs to check the list dynamically.

So far so good. This can be achieved – and sorted the way I need – like this:

<?php     $  cat_terms = get_terms(         array('type'),             array(             'hide_empty' => true,             'orderby' => 'name',             'order' => 'ASC',             'number' => 9999              )         );     if( $  cat_terms ) :     foreach( $  cat_terms as $  term ) :     echo '<h5>'. $  term->name .'</h5>'; ?>  <?php $  args = array(     'post_type' => 'work',     'posts_per_page' => 9999, // Assuming no-one is this prolific     'post_status' => 'publish',     'tax_query' => array(         array(             'taxonomy' => 'type',             'field' => 'slug',             'terms' => $  term->slug,         ),     ),     'ignore_sticky_posts' => true,     'meta_key' => 'date',     'orderby' => 'meta_value',     'order' => 'DESC' );     $  _works = new WP_Query( $  args );         if( $  _works->have_posts() ) :             echo '<table>';                 while( $  _works->have_posts() ) : $  _works->the_post(); ?>                     <tr>                         <td><?php the_field('date'); ?><td><?php the_title(); ?></td>                     </tr>                 <?php endwhile;             echo '</table>';         endif;     wp_reset_postdata();     endforeach;     endif; ?> 

I then need to be able to display the content of the CPT (a small amount of data in a few custom fields) in another div in the same page (and not link out to a single-work.php template as would be more usual). This would be like a tabbed content effect – one posts’ content displayed at a time, chosen from the category-based list on the page.

enter image description here

I could create this second part by loading everything and toggling visibility via jQuery but that would mean loading 200+ posts with the page and making them invisible, which strikes me as a terrible idea.

Is it possible to fetch/load the content of the selected post dynamically on click, so only the posts required are queried beyond the initial list? How would this be handled, and where would I begin with it?

Why my website is not showing up when searched for in Google Maps pack in Google Search

I have a client and we’ve been doing SEO for them since more than the past 6 months now. We’re almost getting them on the first page for target keywords. It’s a local business and, thus, we’re doing Local SEO for them. However, the client is getting impatient. I’ve shown on Google Search Console that their website is showing up on page 1 for target keywords through the maps pack. I was able to achieve this level of reporting by UTM tagging the GMB website URL with:

Source: google Medium: organic Campaign: gmb-listing

This helped me pinpoint page 1 rankings. However, I’m finding it hard to explain to the client that you won’t see the listing all the time.

She searches and does not find the website. I’ve explained that today’s search results are personalised and there are several factors that affect the positions. I googled to look for an explanation of why it does show the impressions in GSC, but, may not show on Google all the time and to everyone.

My issue is that I can’t find resources online to explain to the client why you won’t see the Google Maps result when you search for it although impressions, page 1 (and position 1) ranking and clicks do show in GSC.