Skip to content

Instantly share code, notes, and snippets.

View shaunpalmer's full-sized avatar

shaun palmer shaunpalmer

View GitHub Profile
// Custom Taxonomies
function SP_PS_register_recommendations_taxonomies() {
// Type of recommendations taxonomy
$labels = array(
'name' => 'Type of recommendations',
'singular_name' => 'Type of recommendations',
'search_items' => 'Search Types of recommendations',
'all_items' => 'All Types of recommendations',
'parent_item' => 'Parent Type of recommendations',
@shaunpalmer
shaunpalmer / members_cpt.php
Last active June 26, 2021 05:39
members_cpt
<?php
/*
* Plugin Name: members_cpt
Plugin URI:https://shaunpalmer.co.nz
Description: members_cpt Custom Post Type & taxonomies that adds custom post types
Version: 0.1.6
Author: shaun palmer
Author URI: [email protected]
Text Domain: sp-ps-td-shaun-palmer
*Tested up to: 5.1
wp_register_style('my_plugin_name_dashicons', plugins_url( MY_PLUGIN_NAME.'/css/my-plugin-name.css'));
wp_enqueue_style('my_plugin_name_dashicons');
add_menu_page('My Plugin Settings', 'My Plugin Name', 'administrator', MY_PLUGIN_NAME, 'my_plugin_settings_page', 'dashicons-hanger');
@shaunpalmer
shaunpalmer / RegisterCustomPostTypePlusVariables.php
Last active June 28, 2021 13:29
Register Custom Post Type Plus Variables
<?php
//change to the right function name
function spwp_register_post_type() {
$singular = 'members Page'; //change to the right post type name
$plural = 'members Page'; //change to the right post type names
$detailed_description = 'description'; //change to the right description
$textdomain = 'sp-ps-td-shaun-palmer'; //change to the right text domain
$spwp_post_type = 'spwp_register_post_type'; //change to the right function name
$labels = array(
'name' => $plural,
@shaunpalmer
shaunpalmer / wp_enqueue_style.php
Created June 28, 2021 13:05
function enqueue style
function sp_sp_resources() {
wp_enqueue_style('style', get_stylesheet_uri());
}
add_action('wp_enqueue_scripts', 'sp_sp_resources');
@shaunpalmer
shaunpalmer / tutorial.php
Created June 29, 2021 10:49
tutorial Custom Post Type
<?php
/*
* Plugin Name: tutorial
Plugin URI:https://shaunpalmer.co.nz
Description: All tutorial Custom Post Type & taxonomies that adds custom post types
Version: 0.1.6
Author: shaun palmer
Author URI: [email protected]
Text Domain: sp-ps-td-shaun-palmer
*Tested up to: 5.7
@shaunpalmer
shaunpalmer / Custom_Landing _Page.php
Created July 2, 2021 09:03
Landing Page Boiler Plate
<?php
/* Landing Page Boiler Plate */
$key = lp_get_parent_directory(dirname(__FILE__));
$path = LANDINGPAGES_UPLOADS_URLPATH ."$key/";
$url = plugins_url();
/* Define Landing Pages's custom pre-load hook for 3rd party plugin integration */
do_action('lp_init');
@shaunpalmer
shaunpalmer / create-guten-block.php
Last active July 22, 2021 09:16
create-guten-block
ahmadawais/create-guten-block
https://github.com/ahmadawais/create-guten-block
or
genesis custom blocks- wordpress.org /plugins/genesis-custom-blocks
or
ACF custom blocks
@shaunpalmer
shaunpalmer / enqueuegooglefontsstyles.php
Created August 9, 2021 10:14
enqueue google fonts & styles
function SP_SP_Block_editor_fonts(){
//enqueue google fonts & styles
wp_enqueue_styles(‘SP_SP_Block_editor_fonts’, 'https:///google_fonts_string');
}
Add action( 'enqueue_block_editor_assets' , 'SP_SP_Block_editor_fonts');
//https://wp.zacgordon.com/2017/12/26/how-to-add-javascript-and-css-to-gutenberg-blocks-the-right-way-in-plugins-and-themes/
@shaunpalmer
shaunpalmer / noindex
Created August 13, 2021 07:39
Don't index this page page
<meta name="robots" content="noindex" />