Disable / hide example preview using elementor editor on page with shortcode

Always use output buffers with shortcode to ensure the content is captured and displayed only where shortcode is used. So your code will get modified as follows: add_shortcode(‘apartmentList’, function() { ob_start(); include ‘ApartmentLists/ApartmentListOne.php’; return ob_get_clean(); }); Also, if you are looking to stop the display of the shortcode content completely on the Elementor Editor, you … Read more

get_avatar() Returning a Number

your code will pretty much produce errors like missing ; at the end this code for example <?php esc_url( the_author_meta( ‘user_url’ ) ) ?> the correct code should be <?php echo esc_url( get_the_author_meta( ‘user_url’ ) ); ?> or <?php the_author_meta( ‘user_url’ ); ?> Why does the author ID number appear? The number that appears above … Read more

Unable to upload media to WordPress

Cross-Check .htaccess # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress If the above does not work, try Adding this line to wp-config.php define(‘WP_TEMP_DIR’, ABSPATH . ‘wp-content/uploads/’); Potential Root Causes to Explore Firewall or DDoS Protection: Some … Read more

How to inject right sidebar on post edit page?

I did not support this because of the difficulty of implementation. However, Gutenberg is made with ReactJS, and a slot called PluginPostStatusInfo is provided, so it seems possible to inject your own React elements by using this slot. https://github.com/WordPress/gutenberg/blob/trunk/docs/reference-guides/slotfills/plugin-post-status-info.md

link a page I created as a under construction and link it to the menu

I believe setting the coming soon as the shop page will accomplish what you want but I may be misunderstanding what you want accomplished. To set the WooCommerce shop page, navigate to WooCommerce > Settings and click the Products Tab. In the section labeled “shop page,” click the dropdown and choose your coming soon page.

How can I use an alternate header when a query var is present

ChatGPT provided a working solution: function load_custom_header_for_campaign( $template ) { // Check if the ‘campaign’ query var is set if (isset($_GET[‘campaign’])) { // Load the header-lp.php file instead of the default header add_filter(‘get_header’, function($header) { return ‘lp’; // This will load header-lp.php }); } return $template; } add_filter(‘template_include’, ‘load_custom_header_for_campaign’); It notes: The issue you’re encountering … Read more

Re-use date format on different template

Apologies for the off-topic question. I found the answer on StackOverflow, it’s a PHP question not specific to WordPress. The following code changes the format as required. From https://stackoverflow.com/questions/2487921/convert-a-date-format-in-php <?php $new_checkin = date(‘jS F Y’, strtotime($checkin)); ?> <?php echo esc_html( $new_checkin ); ?>

WooCommerce – how to display product category title above product category images?

1). Copy the Template File Navigate to wp-content/plugins/woocommerce/templates/loop/ Find category.php Copy it to your theme at wp-content/themes/your-theme/woocommerce/loop/category.php 2).Modify the category.php File Open category.php in a code editor and update it to separate the title from the image: <?php /** * The template for displaying product category thumbnails within loops. */ if (!defined(‘ABSPATH’)) { exit; } … Read more