/**
  * Add code to footer to render the footer links (year, privacy policy).
  *
  * @since 0.1.0
  */
 public function render_footer_links()
 {
     $footer_links_html = WPGo_Theme_Customizer::get_customizer_theme_option('wpgo_txtar_footer_links');
     echo do_shortcode($footer_links_html);
     // process any shortcodes in the footer HTML
 }
 /**
  * Append color styles to customize.css.
  *
  * @since 0.2.0
  */
 public function customize_save_after($wp_customize)
 {
     global $wpgo_color_pickers;
     ob_start();
     // start recording output
     /* Get the values of the posted customizer controls. */
     $post_values = json_decode(wp_unslash($_POST['customized']), true);
     /* Get posted array keys. */
     $post_values_keys = array_keys($post_values);
     foreach ($wpgo_color_pickers as $wpgo_color_picker) {
         if (in_array(WPGO_CUSTOMIZE_DB_NAME . '[' . $wpgo_color_picker['setting'] . ']', $post_values_keys)) {
             foreach ($wpgo_color_picker['css'] as $css_selector => $css_rule) {
                 echo $css_selector . " {\r\n" . $css_rule . ": " . $post_values[WPGO_CUSTOMIZE_DB_NAME . '[' . $wpgo_color_picker['setting'] . ']'] . ";\r\n}\r\n\r\n";
             }
         }
     }
     $css = ob_get_contents();
     // get output contents
     ob_end_clean();
     // end recording output and flush buffer
     /* Update the customize.css version number when customizer options manually saved. */
     WPGo_Theme_Customizer::set_customize_css_version();
     /* Append CSS to customize.css. */
     WPGo_Theme_Customizer::write_customize_css($css);
 }
예제 #3
0
    $args = array('theme_location' => WPGO_CUSTOM_NAV_MENU_2);
    wp_nav_menu($args);
    ?>
				</nav>
			<?php 
}
?>

			<div id="logo-wrap">
				<?php 
if (is_front_page() || is_home() || is_archive()) {
    echo '<h1 id="site-title"><span><a href="' . get_home_url() . '" />' . get_bloginfo('name') . '</a></span></h1>';
} else {
    echo '<h2 id="site-title"><span><a href="' . get_home_url() . '" />' . get_bloginfo('name') . '</a></span></h2>';
}
$opt = WPGo_Theme_Customizer::get_customizer_theme_option('wpgo_chk_hide_description');
if (empty($opt)) {
    ?>
					<div id="site-description"><?php 
    bloginfo('description');
    ?>
</div>
				<?php 
}
?>

			</div>
			<!-- #logo-wrap -->

		</header>
		<!-- header -->
 /**
  * Callback function for the 'template_redirect' hook.
  *
  * Set some framework global variables.
  *
  * @since 0.1.0
  */
 public function set_globals()
 {
     /* WordPress global post and wp_query objects. */
     global $post, $wp_query;
     /* Framework globals. */
     global $wpgo_post_object;
     /* Current post object. */
     global $wpgo_is_front_page;
     /* Front page status. */
     global $wpgo_home_page;
     /* Home page status. */
     global $wpgo_post_id;
     /* Post ID. */
     global $wpgo_show_on_front;
     /* Store the front page reading setting. */
     global $wpgo_global_column_layout;
     /* Correct column layout to use for current page. */
     global $wpgo_page_on_front;
     $wpgo_post_object = $post;
     $wpgo_is_front_page = is_front_page();
     $wpgo_home_page = is_home();
     /* Test $wp-query->queried_object property, and that it has a valid ID, as it may not always exist (i.e. on 404.php page, or search.php). */
     //$wpgo_post_id = isset( $wp_query->queried_object ) ? $wp_query->queried_object->ID : null;
     // This will be null for 404 or search pages, or of WP_Post, WP_User object, stdClass class type etc.
     $wpgo_queried_object = get_queried_object();
     $wpgo_post_id = isset($wpgo_queried_object->ID) ? $wpgo_queried_object->ID : null;
     /* Modify the post ID if necessary.
      *
      * i.e. if 'A static page' has been selected on reading settings.
      * In this case the post ID for the static page set for the blog posts will be invalid.
      *
      */
     $wpgo_show_on_front = get_option('show_on_front');
     $wpgo_page_on_front = get_option('page_on_front');
     if ($wpgo_show_on_front == 'page') {
         /* If the 'Posts page'. */
         if (is_home()) {
             /* Use the 'page_for_posts' WP option to get the 'correct' ID for this page.
              * Otherwise all other attempts at getting the post ID results in the first ID
              * in the posts loop. */
             $wpgo_post_id = get_option('page_for_posts');
         }
     }
     /*
      * If current page is an archive OR front page with 'Your latest posts' OR front page with reading settings
      * set to static page but the front page drop down not set, then use the default theme column layout.
      */
     if (is_archive() || $wpgo_is_front_page && $wpgo_show_on_front == 'posts' || $wpgo_home_page && $wpgo_page_on_front == 0) {
         $wpgo_global_column_layout = WPGo_Theme_Customizer::get_customizer_theme_option('wpgo_drp_default_layout');
     } else {
         $wpgo_global_column_layout = get_post_meta($wpgo_post_id, '_wpgo_column_layout', true);
     }
     if (empty($wpgo_global_column_layout) || $wpgo_global_column_layout == 'default') {
         $wpgo_global_column_layout = WPGo_Theme_Customizer::get_customizer_theme_option('wpgo_drp_default_layout');
     }
     /* Set the global WordPress $content_width variable. */
     WPGo_Utility::set_content_width($wpgo_global_column_layout);
 }