コード例 #1
0
/**
 * Execute Analytics code further down the page
 * @link https://codex.wordpress.org/Plugin_API/Action_Reference/wp_footer
 */
function bigblank_theme_options_render_analytics()
{
    $options = bigblank_get_theme_options();
    echo $options['footer_analytics'];
}
コード例 #2
0
<?php

/**
 * Display social media links set from theme options settings
 *
 */
$options = bigblank_get_theme_options();
$facebook = $options['facebook'];
$twitter = $options['twitter'];
$googleplus = $options['googleplus'];
$instagram = $options['instagram'];
$youtube = $options['youtube'];
$pinterest = $options['pinterest'];
if ($facebook || $twitter || $googleplus || $instagram || $youtube || $pinterest) {
    ?>
    <div class="social-media">
        <?php 
    if ($facebook) {
        ?>
            <a href="<?php 
        echo $facebook;
        ?>
" class="fa fa-facebook"></a>
        <?php 
    }
    ?>
        <?php 
    if ($twitter) {
        ?>
            <a href="<?php 
        echo $twitter;
コード例 #3
0
/**
 * Check theme options for comments settings, and overwrite comments open
 * @link https://codex.wordpress.org/Function_Reference/comments_open
 * 
 * 
 * @param bool        $open    Whether the current post is open for comments.
 * @param int|WP_Post $post_id The post ID or WP_Post object.
 * @return boolean
 */
function bigblank_comments_open($open, $post_id)
{
    $post = get_post($post_id);
    $options = bigblank_get_theme_options();
    if ('page' == $post->post_type) {
        $comments = $options['page_comments'];
    } else {
        $comments = $options['post_comments'];
    }
    if ($comments !== 'on') {
        $open = false;
    }
    return $open;
}