This file contains 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 | |
/** | |
* Load dynamic CSS stylesheet in WordPress. There are 4 steps: | |
* | |
* 1. Enqueue dynamic stylesheet on front end or add inline CSS if in Customizer. | |
* 2. Get the dynamic CSS with AJAX calls. | |
* 3. Generate CSS using PHP variables. | |
* 4. Minify CSS after before loading. | |
*/ |
This file contains 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', 'book_create_custom_taxonomy' ); | |
function book_create_custom_taxonomy() { | |
// Book | |
$book = array( | |
'name' => _x( 'Book', 'taxonomy general name' ), | |
'singular_name' => _x( 'Book', 'taxonomy singular name' ), | |
'menu_name' => __( 'Book' ), | |
'all_items' => __( 'All Books' ), | |
'parent_item' => __( 'Parent Book' ), |
This file contains 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( 'genesis_before_footer', 'my_custom_query' ); | |
function my_custom_query() { | |
$post_id = 956; | |
$queried_post = get_post($post_id); | |
echo $queried_post->post_content; | |
} |
This file contains 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 genesis layout classes to the Block Editor. | |
// File lives in the theme's /js/ folder. | |
wp.domReady(function () { | |
yourTheme.updateLayoutClass(); | |
var layouts = document.querySelector(".genesis-layout-selector"); | |
layouts.addEventListener("input", function (e) { | |
yourTheme.updateLayoutClass(); | |
}); | |
}); |
This file contains 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 | |
add_filter( 'render_block', 'custom_wrap_html_block_output', 10, 2 ); | |
/** | |
* Wrap output of HTML blocks. | |
* | |
* @param string $block_content Original block content. | |
* @param array $block Block info. | |
* @return string The block content with a wrapper. | |
*/ |
This file contains 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 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
return array( | |
'dependencies' => array( | |
'plugins' => array( | |
array( | |
'name' => __( 'Atomic Blocks', 'genesis-sample' ), | |
'slug' => 'atomic-blocks/atomicblocks.php', | |
), | |
), | |
), | |
'content' => array( |
This file contains 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
function modify_post_type() { | |
//new args | |
$args = array( | |
'public' => true, | |
'label' => 'Posts', | |
'show_in_rest' => true, | |
'template' => array( | |
array( 'core/cover-image' ), | |
array( 'core/image' ), |
This file contains 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 | |
/** | |
* Genesis Sample. | |
* | |
* This file adds functions to the Genesis Sample Theme. | |
* | |
* @package Genesis Sample | |
* @author StudioPress | |
* @license GPL-2.0+ | |
* @link http://www.studiopress.com/ |
NewerOlder