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 | |
/** | |
* Conditional to test if we're in the loop of the main query on a WordPress page. | |
* Please note that checking `in_the_loop() && is_main_query()` will NOT work in | |
* this scenario. | |
*/ | |
add_action( 'loop_start', 'my_loop_start' ); | |
add_action( 'loop_end', 'my_loop_end' ); |
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 | |
/** | |
* Hybrid Media Grabber - A script for grabbing media related to a post. | |
* | |
* Hybrid Media Grabber is a script for pulling media either from the post content or attached to the | |
* post. It's an attempt to consolidate the various methods that users have used over the years to | |
* embed media into their posts. This script was written so that theme developers could grab that | |
* media and use it in interesting ways within their themes. For example, a theme could get a video | |
* and display it on archive pages alongside the post excerpt. | |
* |
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: Theme Hybrid - API | |
* Plugin URI: http://themehybrid.com | |
* Description: API for ThemeHybrid.com | |
* Version: 0.1.0 | |
* Author: Justin Tadlock | |
* Author URI: http://justintadlock.com | |
*/ |
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 | |
# Register custom post types on the 'init' hook. | |
add_action( 'init', 'my_register_post_types' ); | |
/** | |
* Registers post types needed by the plugin. | |
* | |
* @since 1.0.0 | |
* @access public |
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 | |
/** | |
* HTML attribute functions and filters. The purposes of this is to provide a way for theme/plugin devs | |
* to hook into the attributes for specific HTML elements and create new or modify existing attributes. | |
* This is sort of like `body_class()`, `post_class()`, and `comment_class()` on steroids. Plus, it | |
* handles attributes for many more elements. The biggest benefit of using this is to provide richer | |
* microdata while being forward compatible with the ever-changing Web. Currently, the default microdata | |
* vocabulary supported is Schema.org. | |
*/ |
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
<!DOCTYPE html> | |
<html lang="en-EN"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Test custom background & header</title> | |
</head> | |
<body class="wordpress" itemscope="itemscope" itemtype="http://schema.org/WebPage"> |
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 | |
/** | |
* Extends the WordPress background image customize control class, which allows a theme to register | |
* multiple default backgrounds for the user to choose from. To use this, the theme author | |
* should remove the 'background_image' control and add this control in its place. | |
* | |
* @since 0.1.0 | |
* @author Justin Tadlock <[email protected]> | |
* @copyright Copyright (c) 2013, Justin Tadlock | |
* @link http://justintadlock.com/archives/2013/10/13/registering-multiple-default-backgrounds |
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: Fruity Fruit | |
Description: An example plugin to test saving multiple meta values. | |
*/ | |
add_action( 'add_meta_boxes_post', 'fruity_fruit_add_meta_boxes' ); | |
add_action( 'save_post', 'fruity_fruit_save_meta', 10, 2 ); | |
function fruity_fruit_add_meta_boxes() { |
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 | |
/** | |
* The radio image customize control extends the WP_Customize_Control class. This class allows | |
* developers to create a list of image radio inputs. | |
* | |
* Note, the `$choices` array is slightly different than normal and should be in the form of | |
* `array( | |
* $value => array( 'url' => $image_url, 'label' => $text_label ), | |
* $value => array( 'url' => $image_url, 'label' => $text_label ), | |
* )` |
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 | |
/** | |
* Customize control class to handle color palettes. | |
* | |
* @package Hybrid | |
* @subpackage Classes | |
* @author Justin Tadlock <[email protected]> | |
* @copyright Copyright (c) 2008 - 2015, Justin Tadlock | |
* @link http://themehybrid.com/hybrid-core | |
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
OlderNewer