/**
  * 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
 }
 /**
  * Add theme specific theme customizer color styles via 'wp_head' action hook.
  *
  * @since 0.1.0
  */
 public function add_theme_customizer_colors()
 {
     global $wpgo_color_pickers, $wpgo_customizer_defaults;
     echo '<!-- ' . WPGO_THEME_NAME . ' customizer styles -->';
     echo '<style type="text/css">';
     /* If theme supports 'custom-background' then use that bg color (if it exists), otherwise use color scheme bg. */
     $bg_default = WPGo_Theme_Customizer::get_customizer_theme_option('background_color');
     if (current_theme_supports('custom-background')) {
         /* If no bg color exists in db then use default from color scheme array. */
         $bg = get_theme_mod('background_color');
         if (empty($bg)) {
             echo 'body { background-color: ' . $bg_default . ';}';
         }
     } else {
         echo 'body { background-color: ' . $bg_default . ';}';
     }
     foreach ($wpgo_color_pickers as $wpgo_color_picker) {
         $col = WPGo_Theme_Customizer::get_customizer_theme_option($wpgo_color_picker['setting']);
         foreach ($wpgo_color_picker['css'] as $css_selector => $css_rule) {
             echo $css_selector . " {" . $css_rule . ": " . $col . ";}";
         }
     }
     echo "</style>";
     echo "\r\n";
 }
Exemplo n.º 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);
 }