コード例 #1
0
$hamza_lite_recent_cat = get_theme_mod('hamza_lite_recent_category');
?>

<?php 
if (!empty($hamza_lite_call_to_action_post_id)) {
    ?>
<section id="about-section">
	<div class="ak-container clearfix">
	<?php 
    $hamza_lite_query1 = new WP_Query('p=' . $hamza_lite_call_to_action_post_id);
    while ($hamza_lite_query1->have_posts()) {
        $hamza_lite_query1->the_post();
        ?>
					 
        <h1 class="roboto-light main-title <?php 
        echo hamza_lite_title_class();
        ?>
"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        echo hamza_lite_get_title();
        ?>
</a></h1>
        <div class="welcome-detail">
            <?php 
        if ($hamza_lite_call_to_action_post_content != 1 || empty($hamza_lite_call_to_action_post_content)) {
            ?>
                    <p class="welcome-content"><?php 
            echo hamza_lite_truncate(get_the_content(), $hamza_lite_call_to_action_post_char, '...', false, true);
            ?>
コード例 #2
0
function hamza_lite_bxslidercb()
{
    $hamza_lite_slider_type = get_theme_mod('hamza_lite_slider_type', 'single_post_slider');
    $hamza_lite_slider_one = get_theme_mod('hamza_lite_slider_one');
    $hamza_lite_slider_two = get_theme_mod('hamza_lite_slider_two');
    $hamza_lite_slider_three = get_theme_mod('hamza_lite_slider_three');
    $hamza_lite_slider_four = get_theme_mod('hamza_lite_slider_four');
    $hamza_lite_slider_category = get_theme_mod('hamza_lite_slider_category');
    $hamza_lite_slider_option = get_theme_mod('hamza_lite_slider_option', 'show');
    $hamza_lite_slider_captions = get_theme_mod('hamza_lite_slider_captions', 'show');
    if ($hamza_lite_slider_option == 'show') {
        if (isset($hamza_lite_slider_one) && !empty($hamza_lite_slider_one) || isset($hamza_lite_slider_two) && !empty($hamza_lite_slider_two) || isset($hamza_lite_slider_three) && !empty($hamza_lite_slider_three) || isset($hamza_lite_slider_four) && !empty($hamza_lite_slider_four) || isset($hamza_lite_slider_category) && !empty($hamza_lite_slider_category)) {
            if ($hamza_lite_slider_type == 'single_post_slider') {
                if (!empty($hamza_lite_slider_one) || !empty($hamza_lite_slider_two) || !empty($hamza_lite_slider_three) || !empty($hamza_lite_slider_four)) {
                    $hamza_lite_sliders = array($hamza_lite_slider_one, $hamza_lite_slider_two, $hamza_lite_slider_three, $hamza_lite_slider_four);
                    $hamza_lite_remove = array(0);
                    $hamza_lite_sliders = array_diff($hamza_lite_sliders, $hamza_lite_remove);
                    ?>
                    <div id="silder-main" class="flexslider">
                        <ul class="slides">
                            <?php 
                    foreach ($hamza_lite_sliders as $hamza_lite_slider) {
                        $hamza_lite_args = array('p' => $hamza_lite_slider, 'post_type' => 'dang-tin');
                        $hamza_lite_loop = new WP_query($hamza_lite_args);
                        if ($hamza_lite_loop->have_posts()) {
                            while ($hamza_lite_loop->have_posts()) {
                                $hamza_lite_loop->the_post();
                                $hamza_lite_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'hamza-lite-slider-image', false);
                                ?>

                                        <li data-thumb="<?php 
                                echo esc_url($hamza_lite_image[0]);
                                ?>
">
                                            <img src="<?php 
                                echo esc_url($hamza_lite_image[0]);
                                ?>
" />

                                            <?php 
                                if ($hamza_lite_slider_captions == 'show') {
                                    ?>
                                                <p class="flex-caption"><?php 
                                    echo hamza_lite_get_title();
                                    ?>
</p>
                                                <!--                                                <div class="slider-caption">
                                                                                                    <div class="ak-container">
                                                                                                        <div class="slider-caption-container">
                                                                                                            <p class="caption-title <?php 
                                    echo hamza_lite_title_class();
                                    ?>
"><?php 
                                    echo hamza_lite_get_title();
                                    ?>
</p>
                                                                                                            <div class="caption-description"><?php 
                                    the_content();
                                    ?>
</div>
                                                                                                            <a href="<?php 
                                    the_permalink();
                                    ?>
"><?php 
                                    _e('Read More', 'hamza-lite');
                                    ?>
</a>
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>-->
                                            <?php 
                                }
                                ?>

                                        </li>
                                        <?php 
                            }
                        }
                        wp_reset_postdata();
                    }
                    ?>
                        </ul>
                    </div>
                    <?php 
                }
            } elseif ($hamza_lite_slider_type == 'cat_post_slider') {
                ?>
                <div class="bx-slider">
                    <?php 
                $hamza_lite_loop = new WP_Query(array('cat' => $hamza_lite_slider_category, 'posts_per_page' => -1));
                if ($hamza_lite_loop->have_posts()) {
                    while ($hamza_lite_loop->have_posts()) {
                        $hamza_lite_loop->the_post();
                        $hamza_lite_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'hamza-lite-slider-image', false);
                        ?>
                            <div class="slides">

                                <img src="<?php 
                        echo esc_url($hamza_lite_image[0]);
                        ?>
" />

                                <?php 
                        if ($hamza_lite_slider_captions == 'show') {
                            ?>
                                    <div class="slider-caption">
                                        <div class="ak-container">
                                            <div class="slider-caption-container">
                                                <h1 class="caption-title <?php 
                            echo hamza_lite_title_class();
                            ?>
"><?php 
                            echo hamza_lite_get_title();
                            ?>
</h1>
                                                <div class="caption-description"><?php 
                            the_content();
                            ?>
</div>
                                                <a href="<?php 
                            the_permalink();
                            ?>
"><?php 
                            _e('Read More', 'hamza-lite');
                            ?>
</a>
                                            </div>
                                        </div>
                                    </div>
                                <?php 
                        }
                        ?>

                            </div>
                            <?php 
                    }
                }
                wp_reset_postdata();
                ?>
                </div>
                <?php 
            }
        }
    }
}