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 my_custom_post_types() { | |
$args = array( | |
'label' => 'Recipes', | |
'hierarchical' => true, | |
'taxonomies => array( 'post_tag' ) | |
); | |
register_post_type( 'recipe', $args ); | |
} | |
add_action( 'init', 'my_custom_post_types' ); |
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
if(function_exists("register_field_group")) | |
{ | |
register_field_group(array ( | |
'id' => 'acf_post-list-options', | |
'title' => 'Post List Options', | |
'fields' => array ( | |
array ( | |
'key' => 'field_543f8a046d65e', | |
'label' => 'Authors', | |
'name' => 'authors', |
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
$args = array( | |
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>' | |
'fields' => apply_filters( 'comment_form_default_fields', array( | |
'author' => | |
'<p class="comment-form-author">' . | |
'<label for="author">' . __( 'Name', 'domainreference' ) . '</label> ' . | |
( $req ? '<span class="required">*</span>' : '' ) . | |
'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . | |
'" size="30"' . $aria_req . ' /></p>', |
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 my_assets() { | |
wp_register_script( 'owl-carousel', get_stylesheet_directory_uri() . '/owl.carousel.js', array( 'jquery' ) ); | |
wp_enqueue_script( 'owl-carousel' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_assets' ); |
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 my_editor_styles() { | |
add_editor_style( 'admin/editor.css' ); | |
} | |
add_action( 'after_setup_theme', 'my_editor_styles' ); |
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 set_mail_html_content_type() { | |
return 'text/html'; | |
} | |
add_action( 'publish_post', 'author_publish_notice', 10 ,2 ); | |
function author_publish_notice( $ID, $post ) { | |
if( 'post' == $post->post_type ) { | |
return; | |
} |
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
global $wpdb; | |
for( $i=1; $i <= 5; $i++ ) { | |
$this_week = 7 * $i; | |
$last_week = 7 * ( $i - 1); | |
$comment_counts[] = | |
$wpdb->get_var( "SELECT COUNT(comment_ID) FROM $wpdb->comments WHERE comment_date > '" . date('Y-m-d H:i:s', strtotime('-' . $this_week . ' days')) . "' AND comment_date < '" . date('Y-m-d H:i:s', strtotime('-' . $last_week . ' days')) . "'" ) ; |
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 my_code_output( $atts, $content ) { | |
return '<pre><code>' . $content . '</code></pre>'; | |
} | |
add_shortcode('code', 'my_code_output'); |
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 user_edit_script( $hook ) { | |
if ( 'profile.php' != $hook ) { | |
return; | |
} | |
wp_enqueue_script( 'my-user-edit', plugin_dir_url( __FILE__ ) . 'js/my-user-edit.js' ); | |
} | |
add_action( 'admin_enqueue_scripts', 'user_edit_script' ); |
OlderNewer