Skip to content

Instantly share code, notes, and snippets.

@cre8tivediva
cre8tivediva / page_landing.php
Last active December 19, 2017 04:19
Custom Landing Page for Swank Child Theme
<?php
/**
* Custom Landing Page for the Swank Child Theme
*
* This file adds the landing page template to the Swank Child Theme.
*
* Template Name: Landing
*
* @package Custom Landing Page for Swank
* @author Anita Carter
@cre8tivediva
cre8tivediva / functions.php
Last active November 25, 2017 19:39
Add Comments to Portfolio Post Type
// Add Comments to Portfolio Custom Post Type (https://codex.wordpress.org/Function_Reference/add_post_type_support)
function add_comments_portfolio() {
add_post_type_support( 'portfolio', 'comments' );
}
add_action( 'init', 'add_comments_portfolio', 11 );
@cre8tivediva
cre8tivediva / functions.php
Last active September 19, 2017 20:29
Add Color Selector and New Color to Maker Pro Child Theme
//* Add support for additional color style options
add_theme_support( 'genesis-style-selector', array(
'maker-dark' => __( 'Maker Dark', 'maker' ),
'maker-medium' => __( 'Maker Medium', 'maker' ),
) );
@cre8tivediva
cre8tivediva / functions.php
Last active October 13, 2021 06:30
Rename the Genesis Portfolio Slug
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
/**
* Rename slug in Genesis Portfolio Plugin.
*
* @author Anita Carter
* @link https://cre8tivediva.com/rename-genesis-portfolio-slug
*/
function rename_portfolio_custom_post_type_slug() {
@cre8tivediva
cre8tivediva / functions.php
Created April 9, 2017 00:32
Add Simple Product CPT
// Register Custom Post Type
function products_post_type() {
$labels = array(
'name' => _x( 'Products', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Product', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Products', 'text_domain' ),
'name_admin_bar' => __( 'Product', 'text_domain' ),
'archives' => __( 'Item Archives', 'text_domain' ),
'attributes' => __( 'Item Attributes', 'text_domain' ),
@cre8tivediva
cre8tivediva / functions.php
Last active March 1, 2017 21:37
Related Posts by One Category (modified from Nick Croft's code - http://designsbynickthegeek.com/tutorials/related-posts-genesis)
//for XHTML themes
add_action( 'genesis_after_post_content', 'child_related_posts' );
//for HTML5 themes
add_action( 'genesis_after_entry_content', 'child_related_posts' );
/**
* Outputs related posts with thumbnail
*
* @author Nick the Geek
* @url http://designsbynickthegeek.com/tutorials/related-posts-genesis
* @global object $post
@cre8tivediva
cre8tivediva / style.css
Created February 9, 2017 06:32
Hide Previous/Next Arrows and Pager Link Buttons from Free Version of Soliloquy
/*
Hide Previous/Next Arrows and Pager Link Buttons from Free Version of Soliloquy
---------------------------------------------------------------------------------------------------- */
.soliloquy-container .soliloquy-prev,
.soliloquy-container .soliloquy-next,
.soliloquy-container .soliloquy-pager-link {
display: none !important;
}
@cre8tivediva
cre8tivediva / style.css
Created August 7, 2016 15:16
Responsive Mobile CSS for Fun Theme When using Full Width Header
//* Place all code in the Media Queries area
@media only screen and (max-width: 1280px) {
.header-image .site-title a {
background-size: contain !important;
height: 0;
min-height: 286px;
}
}
@cre8tivediva
cre8tivediva / functions.php
Last active July 2, 2016 02:27
Display Featured Image on Single Posts in Genesis
// Display Featured Image Above the Title on Single Posts
add_action('genesis_before_entry', 'featured_post_image', 8);
function featured_post_image() {
if (!is_singular('post')) return;
the_post_thumbnail('post-image');
}
@cre8tivediva
cre8tivediva / style.css
Created August 23, 2015 23:22
Simple Social Icons Colored Backgrounds
/*
Custom simple social icons
---------------------------------------------------------------------------------------------------- */
.simple-social-icons ul li.social-bloglovin a,
.simple-social-icons ul li.social-bloglovin a:hover {
background: #1c82e9 !important;
}
.simple-social-icons ul li.social-dribbble a,