New answers tagged

0

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/


0

this code should do the trick, add it to your theme functions.php, or to your functions file in the plugin add_filter("pre_get_document_title", "dynamic_page_title"); function dynamic_page_title(){ if(isset($_SESSION['custom_page_title'])){ return stripslashes($_SESSION['custom_page_title']); } } this will only change the ...


2

You can do it like so: function filterDocumentTitle(string $title): string { // don't change title on admin pages or when global $post is not loaded if (is_admin() || get_the_ID() === false) { return $title; } // don't change title if shortcode is not present in content if (!has_shortcode(get_the_content(), 'caption')) { ...


Top 50 recent answers are included