Using variable as shortcode parameter

The shortcode function behind that shortcode will need to be able to accept an argument so it can return your variable in the expected place. If this is a custom shortcode function you wrote, you’ll have to make that adjustment. If its a third party shortcode, you’ll need to look at their documentation and see … Read more

How to pass text input data to shortcode

You would need to do this in the shortcode function for [api_request]. Here’s a potential answer with a ternary that would check if the $_POST value exists, if so, sanitize and use it, otherwise use the value passed in the shortcode: $q = ( isset( $_POST[‘q’] ) ) ? sanitize_text_field( $_POST[‘q’] ) ? $atts[‘q’]; This … Read more

Executing a shortcode at the top of PAGE template?

The do_shortcode function accepts a string, searches the string for shortcodes, and processes any that are found. That means that… // Use shortcode in a PHP file (outside the post editor). echo do_shortcode(”); … is all you need to run a shortcode (code taken from the Codex). Your request that the shortcode be inserted “somewhere … Read more

How to reuse php templates as shortcodes?

You can write a wrap function for short code like that. function simplest_shortcode_ever() { ob_start(); ?> Your PHP Logic here <?php return ob_get_clean(); } add_shortcode( ‘simple_shortcode’, ‘simplest_shortcode_ever’ ); And then use it[simple_shortcode]

filter custom field with checkboxes and show it with one shortcode

add_shortcode( “Querbett”, “bettenaert”); add_shortcode( “Alkovenbett”, “bettenaert”); add_shortcode( “Queensbett”, “bettenaert”); add_shortcode( “Hubbett”, “bettenaert”); function bettenaert ( $atts, $content = null, $tag ) { modell_nach_bettenart_2( $tag ); } Now use shortcode [Querbett], [Alkovenbett], [Queensbett] or[Hubbett] as required. I hope this may help.

How can I hide the ACF shortcode when empty

the code needs some modification. see below. /***************************************************************************************************************************************************** * * Usage: [acf_href href_before=”mailto:” href=”acf:field_name” text=”acf:field_name”] * * acf:fieldname will retrieve the value of the specified “fieldname” and use that. * get:url_variable will grab a variable from the URL and use that. * * [acf_href href=”acf:my_link” text=”Link to web site”] * [acf_href href_before=”mailto:” href=”acf:email_address” text=”acf:user_name” post_id=”get:post_id”] … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)