コード例 #1
0
 * ----------------------------------------------------------------------
 * Output LiveComposer-based footer ( WP Admin > Appearance > Footers )
 * For WordPress it's a page of custom content type: Footer > lbmn_footer
 */
if (defined('DS_LIVE_COMPOSER_URL') && LBMN_THEME_CONFUGRATED) {
    // Show footer only if LC isn't active
    if (DS_LIVE_COMPOSER_ACTIVE) {
        echo '<footer class="site-footer">The footer is disabled when editing the page.</footer>';
    } else {
        // If not 404 or no search results page otherwise get_the_ID() throws a notice
        if (have_posts()) {
            $post_id = get_the_ID();
        } else {
            $post_id = '';
        }
        $footer_post_id = lbmn_get_footerid_by_pageid($post_id);
        $composer_code = get_post_meta($footer_post_id, 'dslc_code', true);
        $composer_content = '';
        // If composer code not empty
        if ($composer_code) {
            // Generate the composer output
            $composer_content = do_shortcode($composer_code);
        }
        global $dslc_active;
        if ($composer_code) {
            // Show footer content only if LiveComposer edit mode isn't active
            if (!DS_LIVE_COMPOSER_ACTIVE) {
                echo '<footer id="dslc-content" class="site-footer dslc-content dslc-clearfix"><div id="dslc-footer" class="dslc-content dslc-clearfix">' . do_action('dslc_footer_output_prepend') . $composer_content . do_action('dslc_footer_output_append') . '</div></footer>';
            }
        }
    }
コード例 #2
0
 function lbmn_footer_custom_css()
 {
     global $dslc_active;
     global $dslc_css_style;
     global $content_width;
     global $dslc_googlefonts_array;
     global $dslc_post_types;
     $composer_code = '';
     $template_code = '';
     $lc_width = dslc_get_option('lc_max_width', 'dslc_plugin_options');
     if (empty($lc_width)) {
         $lc_width = $content_width . 'px';
     } else {
         if (strpos($lc_width, 'px') === false && strpos($lc_width, '%') === false) {
             $lc_width = $lc_width . 'px';
         }
     }
     echo "\n<!-- Custom Footer Styles -->\n";
     echo '<style type="text/css">';
     // Get composer code
     $post_id = get_the_ID();
     $footer_post_id = lbmn_get_footerid_by_pageid($post_id);
     $composer_code .= get_post_meta($footer_post_id, 'dslc_code', true);
     // If no home page set and blog posts listed on the front
     // output LiveComposer CSS for front page too
     if (is_front_page() && get_option('page_on_front', 0) == 0) {
         $template_post_id = get_theme_mod('lbmn_systempage_frontpage_posts', lbmn_get_page_by_title(LBMN_SYSTEMPAGE_FRONTPAGE_POSTS_DEFAULT, 'lbmn_archive'));
         $composer_code .= get_post_meta($template_post_id, 'dslc_code', true);
     }
     // If composer not used on this page stop execution
     if ($composer_code) {
         // Replace shortcode names
         $composer_code = str_replace('dslc_modules_section', 'dslc_modules_section_gen_css', $composer_code);
         $composer_code = str_replace('dslc_modules_area', 'dslc_modules_area_gen_css', $composer_code);
         $composer_code = str_replace('[dslc_module]', '[dslc_module_gen_css]', $composer_code);
         $composer_code = str_replace('[/dslc_module]', '[/dslc_module_gen_css]', $composer_code);
         // Do CSS shortcode
         do_shortcode($composer_code);
         // Google Fonts Import
         $googlefonts_output = '';
         foreach ($dslc_googlefonts_array as $googlefont) {
             $googlefont = str_replace(' ', '+', $googlefont);
             if ($googlefont != '') {
                 $googlefonts_output .= '@import url("//fonts.googleapis.com/css?family=' . $googlefont . ':100,200,300,400,500,600,700,800,900&subset=latin,latin-ext"); ';
             }
         }
         echo $googlefonts_output;
     }
     // Wrapper width
     echo '.dslc-modules-section-wrapper, .dslca-add-modules-section { width : ' . $lc_width . '; } ';
     // Echo CSS style
     if (!$dslc_active && $composer_code) {
         // $dslc_css_style = str_replace('#dslc-content', '#site-footer', $dslc_css_style);
         echo $dslc_css_style;
     }
     echo '</style>';
 }
コード例 #3
0
 function lbmn_footer_custom_css()
 {
     global $dslc_active;
     global $dslc_css_style;
     global $content_width;
     global $dslc_googlefonts_array;
     global $dslc_post_types;
     $composer_code = '';
     $template_code = '';
     $lc_width = dslc_get_option('lc_max_width', 'dslc_plugin_options');
     if (empty($lc_width)) {
         $lc_width = $content_width . 'px';
     } else {
         if (strpos($lc_width, 'px') === false && strpos($lc_width, '%') === false) {
             $lc_width = $lc_width . 'px';
         }
     }
     // echo "\n<!-- Custom Footer Styles -->\n";
     // echo '<style type="text/css">';
     // Get composer code
     $post_id = get_the_ID();
     $footer_post_id = lbmn_get_footerid_by_pageid($post_id);
     $composer_code .= get_post_meta($footer_post_id, 'dslc_code', true);
     // If no home page set and blog posts listed on the front
     // output LiveComposer CSS for front page too
     if (is_front_page() && get_option('page_on_front', 0) == 0) {
         $template_post_id = get_theme_mod('lbmn_systempage_frontpage_posts', lbmn_get_page_by_title(LBMN_SYSTEMPAGE_FRONTPAGE_POSTS_DEFAULT, 'lbmn_archive'));
         $composer_code .= get_post_meta($template_post_id, 'dslc_code', true);
     }
     // If composer not used on this page stop execution
     if ($composer_code) {
         // Replace shortcode names
         $composer_code = str_replace('dslc_modules_section', 'dslc_modules_section_gen_css', $composer_code);
         $composer_code = str_replace('dslc_modules_area', 'dslc_modules_area_gen_css', $composer_code);
         $composer_code = str_replace('[dslc_module]', '[dslc_module_gen_css]', $composer_code);
         $composer_code = str_replace('[dslc_module ', '[dslc_module_gen_css ', $composer_code);
         $composer_code = str_replace('[/dslc_module]', '[/dslc_module_gen_css]', $composer_code);
         // Do CSS shortcode
         do_shortcode($composer_code);
     }
     if (is_front_page() && get_option('page_on_front', 0) == 0) {
         // dslc_dynamic_css_hook();
     }
 }