Posts

To extract the month and year from your ACF date field (like 11 August 1989), you can do this:

To extract the month and year from your ACF date field (like 11 August 1989), you can do this: ================ To concatenate the month and year with a space (e.g., August 1989 ), just update your code like this:  <?php  $value = get_field("date"); // Example: "11 August 1989" if ( $value ) { $day        = date('j', strtotime($value));       // Day (1–31) $month      = date('F', strtotime($value));       // Full month name $year       = date('Y', strtotime($value));       // 4-digit year $month_year = $month . ' ' . $year;               // Concatenated month and year ?> <p class="date"><?php echo $day; ?></p> <p class="month-year"><?php echo $month_year; ?></p> <?php } ?>

Elementor displays the same shortcode twice (only on editor) Functions.php Two TIme Costom Post

Elementor displays the same shortcode twice. One in the place where the shortcode is placed, and the other right behind the header. The problem only occurs in the editor. On the page, it displays normally. Please help. How can i fix it? I solved the problem :) I used ob_start(); and return ob_get_clean(); function elementor_shorcode_test ( ) { ob_start (); elementor_shorcode_test_output (); return ob_get_clean (); } Example Code: /*Custom Post type start*/ function cw_post_type_events() { $supports = array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', 'revisions', 'post-formats', ); $labels = array( 'name' => _x('Events', 'plural'), 'singular_name' => _x('Event Post', 'singular'), 'menu_name' => _x('Event Post', 'admin menu'), 'name_admin_bar' => _x('event', ...

Get WooCommerce Product using different type single product and multiple products

 Get WooCommerce Product using a different type of single product with left side text and right side image, Right side image and left side image, and multiple products in grids.  <?php add_shortcode("custom_product", "wps_soqopslider"); function wps_soqopslider($atts){ ?> <div class="vc_row wpb_row vc_inner vc_row-fluid hme-prduct">   <?php   $args = [       "post_type" => "product",       "posts_per_page" => 1,   "p"=>$atts['product_id'],       "tax_query" => [           [               "taxonomy" => "product_visibility",               "field" => "name",               "terms" => "featured",           ],       ],   ];   $loop = new WP_Query($args);   if ($loop->have_posts()) {     ...