How to generate auto shortcode for custom post type same as Elementor Template?

There’s nothing to “generate”. All Elementor is doing is giving an example of how to use their shortcode for a specific item. You only need one shortcode client, that accepts a parameter to determine which client to show: add_shortcode( ‘client’, function( $atts ) { $atts = shortcode_atts( [ ‘id’ => null ], $atts, ‘client’ ); … Read more

Help understand and create a loop with WP_query

Maybe the hanstholm in $args without the uppercase ? Also a problem with tax_query Don’t forget to use var_dump($query) for see what hapening. <?php $query = new WP_Query( array( ‘post_type’ => ‘hanstholm’, // name of post type. ‘tax_query’ => array( array( ‘taxonomy’ => ‘kategori’, // taxonomy name ‘field’ => ‘name’, // term_id, slug or name … Read more

How to add badge “new” to the post title which are showed in recent post widgets in wordpress

This should sort you out. I’ve commented as much as possible 🙂 Place the code below in to your functions.php file. function your_recent_posts_by_category_with_badge() { // WP_Query arguments $args = array( ‘category_name’ => ‘catname-1, catname-2′, //’cat’ => 5, //’tag’ => ‘tagname’, //’tag_id’ => 5, ‘posts_per_page’ => 10 ); // Set today’s date $the_date_today = date(‘r’); // … Read more