This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode( 'portfolio_terms', 'custom_portfolio_terms_shortcode' ); | |
/** | |
* Produces the linked post taxonomy terms list. | |
* | |
* Supported shortcode attributes are: | |
* after (output after link, default is empty string), | |
* before (output before link, default is 'Tagged With: '), | |
* sep (separator string between tags, default is ', '), | |
* taxonomy (name of the taxonomy, default is 'category'). | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Register Horizontal Opt-in widget area | |
genesis_register_widget_area( | |
array( | |
'id' => 'horizontal-opt-in', | |
'name' => __( 'Horizontal Opt-in', 'my-theme-text-domain' ), | |
'description' => __( 'This is the horizontal opt-in section.', 'my-theme-text-domain' ), | |
) | |
); | |
// Display Horizontal Opt-in widget area below header |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bring back the missing editor for Posts page | |
add_action( 'edit_form_after_title', 'rgc_posts_page_edit_form' ); | |
function rgc_posts_page_edit_form( $post ) { | |
$posts_page = get_option( 'page_for_posts' ); | |
if ( $posts_page === $post->ID ) { | |
add_post_type_support( 'page', 'editor' ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name | |
* | |
* @package Custom_Featured_Post_Widget | |
* @author Gary Jones | |
* @license GPL-2.0+ | |
* @link http://gamajo.com/ | |
* @copyright 2013 Gary Jones, Gamajo Tech | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'init', 'vc_portfolio_init' ); | |
/** | |
* Register a portfolio post type. | |
* | |
* @link http://codex.wordpress.org/Function_Reference/register_post_type | |
*/ | |
function vc_portfolio_init() { | |
$labels = array( | |
'name' => _x( 'Portfolio', 'post type general name', 'your-plugin-textdomain' ), | |
'singular_name' => _x( 'Portfolio Item', 'post type singular name', 'your-plugin-textdomain' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove_action ( 'genesis_before_header', 'genesis_skip_links', 5 ); | |
add_action ( 'genesis_before_header', 'sk_skip_links', 5 ); | |
/** | |
* Add skiplinks for screen readers and keyboard navigation | |
* | |
* @since 2.2.0 | |
*/ | |
function sk_skip_links() { | |
if ( ! genesis_a11y( 'skip-links' ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Google Tag Manager code in <head> | |
add_action( 'wp_head', 'sk_google_tag_manager1' ); | |
function sk_google_tag_manager1() { ?> | |
<!-- Google Tag Manager --> | |
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | |
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | |
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | |
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | |
})(window,document,'script','dataLayer','GTM-XXXXXX');</script> | |
<!-- End Google Tag Manager --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Make BuddyPress Members page obey its Page layout setting | |
*/ | |
add_filter( 'genesis_pre_get_option_site_layout', 'sk_do_members_page_layout' ); | |
function sk_do_members_page_layout( $opt ) { | |
// if the current page is not the members directory, abort. | |
if ( ! bp_is_members_directory() ) { | |
return; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Enqueue Dashicons | |
add_action( 'wp_enqueue_scripts', 'enqueue_dashicons' ); | |
function enqueue_dashicons() { | |
wp_enqueue_style( 'dashicons' ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add "first" and "last" CSS classes to dynamic sidebar widgets. Also adds numeric index class for each widget (widget-1, widget-2, etc.) | |
*/ | |
function widget_first_last_classes( $params ) { | |
global $my_widget_num; // Global a counter array | |
$this_id = $params[0]['id']; // Get the id for the current sidebar we're processing | |
$arr_registered_widgets = wp_get_sidebars_widgets(); // Get an array of ALL registered widgets | |
if( !$my_widget_num ) {// If the counter array doesn't exist, create it |