コード例 #1
0
function ac_add_inline_styles()
{
    // Check if this is a real page and only continue if it is
    $page_id = ac_get_post_id();
    if ($page_id) {
        // Build the styles
        $main_css = '';
        // Padding
        $page_no_top_space = ac_get_meta('page_no_top_space', array(), ac_get_post_id());
        if ($page_no_top_space) {
            $main_css .= "margin-top: 0; ";
        }
        $page_no_bottom_space = ac_get_meta('page_no_bottom_space', array(), ac_get_post_id());
        if ($page_no_bottom_space) {
            $main_css .= "margin-bottom: 0; ";
        }
        // If we have styles generate the complete output and add inline
        if ($main_css) {
            $main_css = "\n\t\t\t\t.main, .sidebar {\n\t\t\t\t\t" . $main_css . "\n\t\t\t\t}\t\t\t\n\t\t\t";
            wp_add_inline_style('ac-theme', $main_css);
        }
    }
    // Include WooCommerce Inline Styles
    ac_woocommerce_add_inline_styles();
}
コード例 #2
0
function ac_get_post_raw_content()
{
    // Get the current page object
    $post_id = ac_get_post_id();
    if ($post_id) {
        $post = get_post($post_id);
        if ($post) {
            // Return the raw WP content
            return $post->post_content;
        }
    }
    return '';
}
コード例 #3
0
<div class='ac-page-hero-img  ac-no-container-padding <?php 
        echo esc_attr($hero_class);
        ?>
'><?php 
        $slideshow_rendered = ac_render_post_slideshow(true);
        ?>
</div><?php 
        // Don't show the featured image if we have a slideshow
        if ($slideshow_rendered) {
            $show_featured_image = false;
        }
    }
    // -- FEATURED IMAGE --
    // Does this WP page have a featured image?
    if (is_single(ac_get_post_id())) {
        switch (get_post_type(ac_get_post_id())) {
            case 'ac_person':
                return $show_featured_image = false;
                break;
        }
    }
    if ($show_featured_image) {
        ?>
<div class='ac-page-hero-img ac-no-container-padding <?php 
        echo esc_attr($hero_class);
        ?>
'><?php 
        if (shoestrap_featured_image(true, false)) {
            //
        }
        ?>