Using Beaver Builder or Elementor and finding spam comments on attachments and other pages / post despite not using comments on the website? Insert the following code into your child theme’s function.php file. [php] <?php // Add to existing function.php file // Disable support for comments and trackbacks in post types function df_disable_comments_post_types_support() { $post_types […]
Read MoreIf you don’t need author post pages in WordPress disable the link and have them redirect back to the homepage. Add the below code to your themes child function.php file. [php] add_action(‘template_redirect’, ‘my_custom_disable_author_page’); function my_custom_disable_author_page() { global $wp_query; if( is_category() || is_tag() || is_date() || is_author() ) { $wp_query->set_301(); status_header(301); // Redirect to homepage wp_redirect(get_option(‘home’)); […]
Read MoreBelow is the correct way to load JavaScript / jQuery into your WordPress Website. Place the below custom code into your themes child function.php file. Just to note “custom.js” is the file we load from the theme folder. [php] // ADD CUSTOM JS function wpb_adding_scripts() { wp_register_script(‘my_amazing_script’, get_stylesheet_directory_uri() . ‘/custom.js’, array(‘jquery’),’1.1′, true); wp_enqueue_script(‘my_amazing_script’); } add_action( […]
Read MoreIf your not using the “shop” page in your WooCommerce store, add the following your theme’s child function.php file. This code will redirect when you should land on the “shop” page back to the “Home Page” (root). This will change the link on the “Continue Shopping” button. [php] // REDIRECT SHOP URL TO HOMEPAGE add_filter( […]
Read MoreHaving difficulty getting both https (SSL) and www to display in the website URL? Insert the below code into the .htaccess file in the root folder of your website. Obviously this requires both and SSL cert to be installed and working correctly, and also that both the www and non www version of your domain […]
Read MoreHere’s something I found out today, instead of messing around with .htaccess configurations to force a file to download instead of show in the browser, you can simply add the “download” tag to the HTML Anchor link. [html] <a href="myfile.pdf" download>Click to Download</a> [/html] Might save you some time / hassle trying to configure downloading […]
Read More