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
public function mfc_assets() | |
{ | |
wp_enqueue_script('media-upload'); | |
wp_enqueue_script('thickbox'); | |
wp_enqueue_script('mfc-media-upload', plugin_dir_url(__FILE__) . 'mfc-media-upload.js', array( 'jquery' )) ; | |
wp_enqueue_style('thickbox'); | |
} |
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
$wp_customize->add_section( 'cd_colors' , array( | |
'title' => 'Colors', | |
'priority' => 30, | |
) ); |
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 | |
/** | |
* Template Name: Alphabetical Posts | |
*/ | |
get_header(); ?> | |
<div id="main-content" class="main-content"> | |
<?php |
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
/* Regular jQuery */ | |
$('.hideable').on('click', function() { | |
$(this).hide(); | |
}) | |
/* Compatibility Mode */ | |
jQuery('.hideable').on('click', function() { | |
jQuery(this).hide(); | |
}) |
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 | |
$args = array( | |
'post_type' => 'post', | |
'post_status' => 'future' | |
); | |
$scheduled = new WP_Query( $args ); | |
if ( $scheduled->have_posts() ) : | |
?> | |
<?php while( $scheduled->have_posts() ) : $scheduled->the_post() ?> |
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( 'wp_ajax_nopriv_submit_content', 'my_submission_processor' ); | |
add_action( 'wp_ajax_submit_content', 'my_submission_processor' ); | |
function my_submission_processor() { | |
// Handle the form in here | |
} |
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
$wp_customize->add_control( | |
new WP_Customize_Latest_Post_Control( | |
$wp_customize, | |
'featpost_control', | |
array( | |
'label' => __( 'Select A Featured Post', 'mytheme' ), | |
'section' => 'header_section', | |
'settings' => 'featured_post', | |
'post_type' => 'page' | |
) |
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
<h2><a href='<?php the_permalink() ?>'><?php the_title() ?></a></h2> | |
<div class="content"> | |
<?php the_excerpt() ?> | |
</div> |
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
define( 'ALTERNATE_WP_CRON', true ); |
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
public function get_remote_posts() { | |
$posts = get_transient( 'remote_posts' ); | |
if( empty( $posts ) ) { | |
$response = wp_remote_get( 'http://mysite.com/wp-json/wp/v2/posts/' ); | |
if( is_wp_error( $response ) ) { | |
return array(); | |
} | |
$posts = json_decode( wp_remote_retrieve_body( $response ) ); |