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
/** | |
* Show sticky posts on the front page | |
* | |
* @link - https://wordpress.stackexchange.com/questions/202896/query-only-sticky-posts | |
*/ | |
function edward_frontpage_sticky_posts() { | |
$stickies = get_option( 'sticky_posts' ); | |
$features = new WP_Query( | |
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
/** | |
* Show featured posts on the front page | |
* | |
* @link - https://wordpress.stackexchange.com/questions/202896/query-only-sticky-posts | |
*/ | |
function edward_featured_content_list() { | |
$featured = new WP_Query( | |
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
$args = array( | |
'show_option_all' => __( 'Select a category', 'inmyarea' ), | |
//'show_option_none' => '', | |
//'option_none_value' => '-1', | |
'orderby' => 'name', | |
'order' => 'ASC', | |
'hide_empty' => 1, | |
'selected' => $cat, | |
'hierarchical' => 1, | |
'name' => 'browse', |
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 | |
// Sanitize Checkbox. | |
function dbt_sanitize_checkbox( $value ) { | |
if ( 1 == $value ) { | |
return true; | |
} | |
else { | |
return false; | |
} | |
} |
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 | |
// Sanitize YES/NO choice. | |
function dbt_yes_no_choices() { | |
return apply_filters( 'dbt_yes_no_choices', array( | |
'no' => __( 'No' ), | |
'yes' => __( 'Yes' ), | |
) ); | |
} | |
function dbt_sanitize_yes_no_choice( $value ) { |
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 | |
/** | |
* Language | |
* | |
*/ | |
$wp_customize->add_setting( 'WPLANG', array( | |
'type' => 'option', | |
'sanitize_callback' => 'dbt_sanitize_language_choice', | |
) ); | |
$wp_customize->add_control( 'WPLANG', 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
<?php | |
/** | |
* Timezone | |
* | |
*/ | |
$wp_customize->add_setting( 'timezone_string', array( | |
'type' => 'option', | |
'sanitize_callback' => 'sanitize_text_field', | |
) ); | |
class Timezone_Control extends WP_Customize_Control { |
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 | |
/** | |
* Miscellaneous | |
* | |
*/ | |
$advanced_count = 10; | |
$advanced_array = array( | |
__( 'Google Analytics Tracking Code' ) => 'dbt_google_analytics_code', | |
//__( 'Facebook Comments App ID' ) => 'dbt_facebook_comments_app_id', |
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 | |
/** | |
* Google Analytics tracking code. | |
*/ | |
function dbt_add_google_analytics_tracking_code_to_document_head() { | |
$google_analytics_code = get_option( 'dbt_google_analytics_code' ); | |
if ( $google_analytics_code && ! is_user_logged_in() && ! is_customize_preview() ) { ?> | |
<!-- Google Analytics --> |
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
/** | |
* Facebook and Disqus Comments - drop-in replacement for comments.php | |
*/ | |
function dbt_facebook_or_disqus_comments() { | |
if ( comments_open() && get_option( 'dbt_facebook_comments_app_id' ) ) { | |
// If Facebook Comments enabled. | |
if ( get_option( 'WPLANG' ) ) { $language = get_option( 'WPLANG' ); } | |
else { $language = 'en_US'; } ?> | |
<div id="fb-root"></div> |
NewerOlder