Skip to content

Instantly share code, notes, and snippets.

<a style="background-color: turquoise; border-radius: 5px; color: #333; padding: 15px 32px; text-decoration: none;" href="https://getwooplugins.com/plugins/woocommerce-variation-swatches/" type="button">Variation Swatches</a>
@WPCred1
WPCred1 / functions.php
Created March 7, 2023 09:46
WordPress Child Theme
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
function enqueue_parent_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
?>
@WPCred1
WPCred1 / style.css
Created March 7, 2023 09:42
WordPress Child Theme
/*
Theme Name: Beetan
Theme URI: https://pcm.wordpress.org/themes/beetan/
Description: Beetan Child Theme
Author: WP Cred
Author URI: https://wpcred.com
Template: beetan
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
DELETE FROM wp_posts WHERE post_type = "revision";
@WPCred1
WPCred1 / wp-config.php
Created December 20, 2022 10:32
Disable Post Revision
/** Disable Post Revision */
define('WP_POST_REVISIONS', false);
@WPCred1
WPCred1 / wp-config.php
Created December 20, 2022 10:31
Enable Post Revision
/** Enable Post Revision */
define('WP_POST_REVISIONS', true);
@WPCred1
WPCred1 / wp-config.php
Created December 20, 2022 10:29
Post Revision Limit
/** Post Revision Limit*/
define('WP_POST_REVISIONS', 3);
@WPCred1
WPCred1 / functions.php
Created December 15, 2022 06:23
Add Custom Background
$defaults = array(
'default-color' => '',
'default-image' => '',
'default-repeat' => '',
'default-position-x' => '',
'default-position-y' => '',
'default-size' => '',
'default-attachment' => '',
'wp-head-callback' => '_custom_background_cb',
'admin-head-callback' => '',
body.postid-563 {
background-image: url("https://images.unsplash.com/photo-1661956601349-f61c959a8fd4?ixlib=rb-4.0.3&ixid=MnwxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2071&q=80");
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
}
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]