Skip to content

Instantly share code, notes, and snippets.

@WPCred1
WPCred1 / functions.php
Created December 13, 2022 10:58
Adding Admin Notice
/**
*Adding the Admin Notice
*/function wpb_admin_notice_warn() {
echo '<div class="notice notice-warning is-dismissible">
<p>Remember to add internal links to recently published posts!</p>
</div>';
}
add_action( 'admin_notices', 'wpb_admin_notice_warn' );
@WPCred1
WPCred1 / gist:f7c73a06b84fc556b4c3cb96dfcb3abb
Created December 4, 2022 08:53
Creating a function to create our CPT
/*
* Creating a function to create our CPT
*/
function custom_post_type() {
// Set UI labels for Custom Post Type
@WPCred1
WPCred1 / gist:0e37cff5a251cfa68d07d338d2d2f5f5
Created December 4, 2022 08:48
Custom post-type function
// Custom post-type function
function create_posttype() {
register_post_type( 'movies',
// CPT Options
array(
@WPCred1
WPCred1 / additional-css
Created December 2, 2022 06:17
Code for Font Size Changing
p {
font-size: 22px;
}
include('create-custom-shortcode.php');
@WPCred1
WPCred1 / create-custom-shortcode.php
Created November 10, 2022 06:31
Example for creating shortcode
<?php
function download_link(){
return 'Get Best Variation Swatches for WooCommerce <a rel="nofollow" href="https://getwooplugins.com/plugins/woocommerce-variation-swatches/">Download Now!</a>';
}
add_shortcode('download', 'download_link');
?>