Shortcode select another dbbase

Your code looks correct to me, so I suspect there is some kind of issue connecting to the second database. Try the following which will log the last error: $wpdb->show_errors(); if($wpdb->last_error !== ”) : $wpdb->print_error() endif; If you are using multisite, then you will also need to add: define( ‘DIEONDBERROR’, true ); Have a look … Read more

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

Shortcode custom query not passing value

You haven’t defined $atts, so your function isn’t receiving any of the attributes passed by the user. This isn’t sufficient: $atts = shortcode_atts($defaults, $atts); That just combines $atts and $defaults into $atts, but the original $atts hasn’t been defined. You need to accept $atts as the first argument passed to your function: function clients_shortcode( $atts … Read more

Echo short code syntax

the error is saying to change ; to . – you will also want to remove the extra .: <?php echo do_shortcode(“[svg-flag flag=\”” . get_post_meta($post->ID, ‘ozellikler_text’, true) . “\”]”); ?>

Remove figcation from excerpt

Use directly in the templates. echo strip_shortcodes( get_the_excerpt() ); how does it work as follows ? add_filter(‘the_excerpt’, ‘strip_shortcodes’); or add_filter(‘get_the_excerpt’, ‘strip_shortcodes’);