Custom page template from plugin does not work with pre-installed themes in WordPress 6.6.1

Newer themes including Twenty Twenty Four use block themes/Full Site Editing. This means all the templates are created with HTML and theme.json, not using PHP templates at all anymore. You can read up on bloc themes, and see ways to create a “hybrid theme” which uses both PHP and HTML, here – https://fullsiteediting.com/courses/full-site-editing-for-theme-developers/

PHP Deprecated function Optional parameter $function

At your function declaration you need to set the required parameters first, the optional second, because you couldn’t skip $function if $page has to be given: function add_meta_box($id, $title, $page, $function = ”, $context=”advanced”, $priority = ‘default’): void { require_once(ABSPATH . ‘wp-admin/includes/template.php’); add_meta_box($id, $title, array(&$this, $function == ” ? $id : $function), $page, $context, $priority); … Read more

I have to select text from gutenberg editor. Purpose is to store and replace text

We have to select text from the Gutenberg editor. The purpose is to store and replace text. Please use this code to help us with you const { select } = wp.data; const selectedBlock = select(‘core/block-editor’).getSelectedBlock(); if (selectedBlock) { const selectedText = selectedBlock.attributes.content; console.log(“Selected Text:”, selectedText); // Store the selectedText as needed. } Replacing Text … Read more

i have updated my wordpress to 6.3 and getting these errors. please help

The first error: it looks like your update failed: you’ve still got wp-includes/comment.php from a previous version of WordPress. You should back up your site then follow the manual upgrade instructions here https://wordpress.org/documentation/article/updating-wordpress/#manual-update to replace your core files with a fresh copy. (I wouldn’t bother disabling all the plugins etc. though) I’m not sure what … Read more

HTML output from WordPress shortcode is wrapped in unexpected tags

Please try as below: function wp_reservations_shortcode($atts) { // remove auto paragraphs for shortcode content remove_filter(‘the_content’, ‘wpautop’); remove_filter(‘the_excerpt’, ‘wpautop’); ob_start(); ?> <section> <section class=”calendar-header”> <button id=”prev-month”>Prev</button> <div class=”current-date”>July 2024</div> <button id=”next-month”>Next</button> </section> <section class=”calendar-body”> <div class=”calendar-weekdays”></div> <div class=”calendar-days”></div> </section> </section> <?php $html = ob_get_clean(); // Re-enable automatic paragraphs add_filter(‘the_content’, ‘wpautop’); add_filter(‘the_excerpt’, ‘wpautop’); return $html; } add_shortcode(‘wp_reservations’, … Read more