コード例 #1
0
ファイル: theme-post-types.php プロジェクト: TestSmirk/MyBlog
function team_social($post)
{
    ?>
    <input id="social_team_input" type="hidden" name="team_social" value="<?php 
    echo get_post_meta($post->ID, 'team_social', true);
    ?>
" />
    <?php 
    socialIconsList('team_social_select');
    ?>
        <input type="text" placeholder="<?php 
    _e('URL', 'metrika');
    ?>
" class="team_social_link">
        <a href="#" id="team_social_add" class="button button-primary button-large"><?php 
    _e('Add', 'precise');
    ?>
</a>
        <div class="team_social_preview">
            <ul class="unstyled">
            <?php 
    if (get_post_meta($post->ID, 'team_social', true) !== '') {
        echo do_shortcode(get_post_meta($post->ID, 'team_social', true));
    }
    ?>
            </ul>
        </div>
    <?php 
}
コード例 #2
0
function headerSocialButton()
{
    socialIconsList();
    ?>
    <input type="text" class="soc-button-url" placeholder="<?php 
    _e('URL', 'metrika');
    ?>
">
    <a href="#" class="add-soc-button button-primary"><?php 
    _e('Add Button', 'metrika');
    ?>
</a><br>
    <?php 
    $buttons = get_option('header_social_buttons');
    if (!empty($buttons['icons'])) {
        echo '<ul class="header-sb-preview unstyled">';
        foreach ($buttons['icons'] as $item) {
            echo '<li data-type="' . $item['type'] . '" data-url="' . $item['url'] . '"><i class="fa fa-' . $item['type'] . '"></i><a href="#" class="delete-button"><i class="fa fa-trash-o"></i></a></li>';
        }
        echo "</ul>";
    } else {
        echo '<ul class="header-sb-preview unstyled"></ul>';
    }
    ?>
    <br>
    <div class="pull-left">
        <label><?php 
    _e('Select Home Social Buttons Color:', 'metrika');
    ?>
</label>
        <?php 
    if (empty($buttons['home_icon_color'])) {
        $buttons['home_icon_color'] = '#50b28a';
    }
    ?>
        <input value="<?php 
    echo $buttons['home_icon_color'];
    ?>
" type="hidden" id="home-soc-buttons-color">
        <select id="home-soc-buttons-colo-type">
            <option value="black" <?php 
    if ($buttons['home_icon_color_type'] == 'black') {
        echo 'selected="selected"';
    }
    ?>
><?php 
    _e('Black', 'metrika');
    ?>
</option>
            <option value="white" <?php 
    if ($buttons['home_icon_color_type'] == 'white') {
        echo 'selected="selected"';
    }
    ?>
><?php 
    _e('White', 'metrika');
    ?>
</option>
            <option value="custom" <?php 
    if ($buttons['home_icon_color_type'] == 'custom') {
        echo 'selected="selected"';
    }
    ?>
><?php 
    _e('Custom Color', 'metrika');
    ?>
</option>
        </select><br>
        <input id="home-soc-buttons-colorpicker" type="text" value="<?php 
    echo $buttons['home_icon_color'];
    ?>
">
    </div>
    <div class="pull-left last">
        <label><?php 
    _e('Select Page Social Buttons Color:', 'metrika');
    ?>
</label>
        <input value="<?php 
    echo $buttons['page_icon_color'];
    ?>
" type="hidden" id="page-soc-buttons-color">
        <select id="page-soc-buttons-colo-type">
            <option value="black" <?php 
    if ($buttons['page_icon_color_type'] == 'black') {
        echo 'selected="selected"';
    }
    ?>
><?php 
    _e('Black', 'metrika');
    ?>
</option>
            <option value="white" <?php 
    if ($buttons['page_icon_color_type'] == 'white') {
        echo 'selected="selected"';
    }
    ?>
><?php 
    _e('White', 'metrika');
    ?>
</option>
            <option value="custom" <?php 
    if ($buttons['page_icon_color_type'] == 'custom') {
        echo 'selected="selected"';
    }
    ?>
><?php 
    _e('Custom Color', 'metrika');
    ?>
</option>
        </select><br>
        <?php 
    if (empty($buttons['page_icon_color'])) {
        $buttons['page_icon_color'] = '#50b28a';
    }
    ?>
        <input id="page-soc-buttons-colorpicker" type="text" value="<?php 
    echo $buttons['page_icon_color'];
    ?>
">
    </div>
    <div class="clearfix"></div>
    <a href="#" id="save-header-soc-button" class="button-primary"><?php 
    _e('Save Buttons', 'metrika');
    ?>
</a>
    <span class="soc-save-status"></span>
    <?php 
}