Change published date and time using SQL query for page in every 5 hour
Change published date and time using SQL query for page in every 5 hour
Change published date and time using SQL query for page in every 5 hour
in your function add_shortcode(,), the right way to do it is : add_shortcode(‘displaydate’,’todayfullday ‘); the name of the shortcode first , then the name of the callback function. https://developer.wordpress.org/reference/functions/add_shortcode/
how to display a template.php in a shortcode
php dynamic content inside shortcode
You can always do a var_dump() of $current_user to see what it contains. You’ll see there is a similar property to user_firstname: user_lastname. You’ll probably want a space between the first and last name, so a small edit should add the last name: function custom_shortcode_func() { ob_start(); $current_user = wp_get_current_user(); echo ‘Willkommen ‘ . $current_user->user_firstname … Read more
From your comment: (formatted for brevity) The cute thing is I debugged that TEMPLATE_MODULE_DIR . ‘my-template.php’ and the path in a plugin’s subfolder is right in fact as I said in my post, with include_once it loads perfectly So because you said it’s in a plugin subfolder (in wp-content/plugins), then as I said in the … Read more
If it is the user ID, that you need to pass to the shortcode, then you can first use get_current_user_id() to get the ID. After that, use it int the shortcode string. Depending on the shortcode and your exact use case either check, if the ID is 0, or don’t. With check, // user ID … Read more
Shortcode to appear and show the date not code in Title and description of my website
Auto embeds don’t work for attachment descriptions
do a print_r to your $a variable, there you see everything that is happening echo ‘<pre>’; print_r($a); echo ‘</pre>’; die(); this way you can see if the url variable has double quotes, because it seems it doesnt have.