示例#1
0
<?php

$site_style = boston_get_option('site_style');
if ($site_style == 'dark') {
    $site_logo = boston_get_option('site_logo_dark');
} else {
    $site_logo = boston_get_option('site_logo');
}
if (!empty($site_logo['url'])) {
    ?>
    <a href="<?php 
    echo esc_url(home_url('/'));
    ?>
" class="site-logo">    
        <img src="<?php 
    echo esc_url($site_logo['url']);
    ?>
" title="" alt="" width="<?php 
    echo esc_attr($site_logo['width']);
    ?>
" height="<?php 
    echo esc_attr($site_logo['height']);
    ?>
">
    </a>
<?php 
}
<?php

$main_font = boston_get_option('main_font');
$secondary_color = boston_get_option('secondary_color');
?>

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
.header .navbar {
    font-family: <?php 
echo esc_html($main_font);
?>
, 'sans-serif';
}

.widget_rss .widget-header h3 a:hover,
.logged-in-as a:hover,
.logged-in-as a,
.slider .item .item-content h4 a:hover,
.copyrights .copyrights-inner p a:hover,
.copyrights .copyrights-inner p a,
.widget_handpicked_posts .media .media-body .media-heading a:hover,
footer .footer-widget ul li a:hover,
.leave-comment #reply-title a,
.post-comments .comments .comment .media .media-body .comment-meta .comment-reply:hover,
示例#3
0
<?php

/*==================
 SINGLE BLOG POST
==================*/
get_header();
the_post();
$blog_listing_single_layout = boston_get_option('blog_listing_single_layout');
?>

<main class="<?php 
echo esc_attr($blog_listing_single_layout);
?>
">

        <div class="container">
            <div class="row">

                <?php 
if ($blog_listing_single_layout == 'left_sidebar') {
    ?>
                    <!-- sidebar -->
                    <div class="col-md-3 no-padding">
                        <aside class="sidebar">

                           <?php 
    get_sidebar();
    ?>

                        </aside>
                    </div>
    <div class="container">
        <div class="row">

           <!-- single -->
            <div class="col-md-12 no-padding">

                <!-- post single -->
                    <section class="post-single clearfix">

                        <!-- post -->
                        <article class="post clearfix no-margin">

                            <div class="contact_map">
                                <?php 
$contact_map = boston_get_option('contact_map');
if (!empty($contact_map)) {
    foreach ($contact_map as $long_lat) {
        echo '<input type="hidden" value="' . esc_attr($long_lat) . '" class="contact_map_marker">';
    }
    ?>
                                    <div class="embed-responsive embed-responsive-16by9">
                                        <div id="map" class="embed-responsive-item"></div>
                                    </div>                        
                                    <?php 
}
?>
                            </div>


                            <div class="row">
示例#5
0
<?php

$logo_padding = boston_get_option('logo_padding');
?>
    <!-- header -->
    <header>
        <div class="container">
            <div class="row">
                <div class="header clearfix">

                    <div class="search-query">
                        <form role="search" method="get" class="searchform" action="<?php 
echo esc_url(site_url('/'));
?>
">
                            <div class="input-group">
                                <input type="text" value="" name="s" class="form-control" placeholder="<?php 
esc_attr_e('Search blog...', 'boston');
?>
">
                                <input type="hidden" name="post_type" value="post">
                            </div>
                        </form>
                    </div>

                    <div class="clearfix">

                        <!-- logo -->
                        <div class="pull-left">
                            <div class="logo" style="<?php 
echo !empty($logo_padding) ? 'padding: ' . esc_attr($logo_padding) . ';' : '';
?>
                    <img class="img-circle" src="<?php 
echo esc_url($avatar_url);
?>
" alt="author"/>
                </a>
            </div>
            <div class="iw-author-header">
                <h5><a href="<?php 
echo esc_url(get_author_posts_url(get_the_author_meta('ID')));
?>
"><?php 
the_author_meta('display_name');
?>
</a></h5>

                <p><?php 
$blog_single_author_desc_length = boston_get_option('blog_single_author_desc_length');
$desc = get_the_author_meta('description');
if (strlen($desc) > $blog_single_author_desc_length && !empty($blog_single_author_desc_length)) {
    $desc = mb_substr($desc, 0, $blog_single_author_desc_length) . '...';
}
echo wp_kses_post($desc);
?>
</p>
            </div>
        </div>
        <!-- #inner widget author -->
    </aside>
</div>
<!-- #inner sidebar -->
示例#7
0
 /**
  * @see Walker::start_el()
  * @since 3.0.0
  *
  * @param string $output Passed by reference. Used to append additional content.
  * @param object $item Menu item data object.
  * @param int $depth Depth of menu item. Used for padding.
  * @param int $current_page Menu item ID.
  * @param object $args
  */
 public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     $indent = $depth ? str_repeat("\t", $depth) : '';
     /**
      * Dividers, Headers or Disabled
      * =============================
      * Determine whether the item is a Divider, Header, Disabled or regular
      * menu item. To prevent errors we use the strcasecmp() function to so a
      * comparison that is not case sensitive. The strcasecmp() function returns
      * a 0 if the strings are equal.
      */
     if (strcasecmp($item->attr_title, 'divider') == 0 && $depth === 1) {
         $output .= $indent . '<li role="presentation" class="divider">';
     } else {
         if (strcasecmp($item->title, 'divider') == 0 && $depth === 1) {
             $output .= $indent . '<li role="presentation" class="divider">';
         } else {
             if (strcasecmp($item->attr_title, 'dropdown-header') == 0 && $depth === 1) {
                 $output .= $indent . '<li role="presentation" class="dropdown-header">' . esc_attr($item->title);
             } else {
                 if (strcasecmp($item->attr_title, 'disabled') == 0) {
                     $output .= $indent . '<li role="presentation" class="disabled"><a href="#">' . esc_attr($item->title) . '</a>';
                 } else {
                     $mega_menu_custom = get_post_meta($item->ID, 'mega-menu-set', true);
                     $class_names = $value = '';
                     $classes = empty($item->classes) ? array() : (array) $item->classes;
                     if (!empty($mega_menu_custom)) {
                         $classes[] = 'mega_menu_li';
                     }
                     $classes[] = 'menu-item-' . $item->ID;
                     $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args));
                     if ($args->has_children) {
                         $class_names .= ' dropdown';
                     }
                     $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : '';
                     $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args);
                     $id = $id ? ' id="' . esc_attr($id) . '"' : '';
                     $output .= $indent . '<li' . $id . $value . $class_names . '>';
                     $atts = array();
                     $atts['title'] = !empty($item->title) ? $item->title : '';
                     $atts['target'] = !empty($item->target) ? $item->target : '';
                     $atts['rel'] = !empty($item->xfn) ? $item->xfn : '';
                     // If item has_children add atts to a.
                     $atts['href'] = !empty($item->url) ? $item->url : '';
                     if ($args->has_children) {
                         $atts['data-toggle'] = 'dropdown';
                         $atts['class'] = 'dropdown-toggle';
                         $atts['data-hover'] = 'dropdown';
                         $atts['aria-haspopup'] = 'true';
                     }
                     $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args);
                     $attributes = '';
                     foreach ($atts as $attr => $value) {
                         if (!empty($value)) {
                             $value = 'href' === $attr ? esc_url($value) : esc_attr($value);
                             $attributes .= ' ' . $attr . '="' . $value . '"';
                         }
                     }
                     $item_output = $args->before;
                     /*
                      * Glyphicons
                      * ===========
                      * Since the the menu item is NOT a Divider or Header we check the see
                      * if there is a value in the attr_title property. If the attr_title
                      * property is NOT null we apply it as the class name for the glyphicon.
                      */
                     $item_output .= '<a' . $attributes . '>';
                     if (!empty($item->attr_title)) {
                         $item_output .= '<div class="menu-tooltip">' . $item->attr_title . '</div>';
                     }
                     $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
                     if (!empty($mega_menu_custom)) {
                         $registered_widgets = wp_get_sidebars_widgets();
                         $count = count($registered_widgets[$mega_menu_custom]);
                         $item_output .= ' <i class="fa fa-angle-down"></i>';
                         $item_output .= '</a>';
                         $mega_menu_min_height = boston_get_option('mega_menu_min_height');
                         $style = '';
                         if (!empty($mega_menu_min_height)) {
                             $style = 'style="height: ' . esc_attr($mega_menu_min_height) . '"';
                         }
                         $item_output .= '<ul class="list-unstyled mega_menu col-' . $count . '" ' . $style . '>';
                         ob_start();
                         if (is_active_sidebar($mega_menu_custom)) {
                             dynamic_sidebar($mega_menu_custom);
                         }
                         $item_output .= ob_get_contents();
                         ob_end_clean();
                         $item_output .= '</ul>';
                     } else {
                         if ($args->has_children && 0 === $depth) {
                             $item_output .= ' <i class="fa fa-angle-down"></i>';
                         }
                         $item_output .= '</a>';
                     }
                     $item_output .= $args->after;
                     $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
                 }
             }
         }
     }
 }
示例#8
0
    public function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Latest Tweets', 'boston') : $instance['title'], $instance, $this->id_base);
        $count = esc_attr($instance['count']);
        $list = '';
        $tweets = boston_return_tweets($count);
        if (!empty($tweets['error'])) {
            $list = '<li class="api_error">API Is Not Set</li>';
        } else {
            if (!empty($tweets) && empty($tweets['errors'])) {
                $reg_exUrl = "/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/";
                $twitter_username = boston_get_option('twitter-username');
                foreach ($tweets as $tweet) {
                    $text = $tweet['text'];
                    if (preg_match($reg_exUrl, $text, $url)) {
                        $text = preg_replace($reg_exUrl, '<a href="' . $url[0] . '">' . $url[0] . '</a> ', $text);
                    }
                    $list .= '
						<li>
							<div class="tweet-bird">
								<i class="fa fa-twitter"></i>
							</div>
							<p>' . $text . '</p>
							<ul class="list-unstyled list-inline tweet-meta">
								<li>
									<a href="http://twitter.com/' . $twitter_username . '/status/' . $tweet['id_str'] . '" target="_blank">
										<i class="fa fa-reply"></i>
									</a>
								</li>
								<li>
									<a href="https://twitter.com/intent/retweet?tweet_id=' . $tweet['id_str'] . '" target="_blank">
										<i class="fa fa-retweet"></i>
									</a>
								</li>
								<li>
									<p>' . human_time_diff(strtotime($tweet['created_at']), current_time('timestamp')) . ' ' . __('ago', 'boston') . '</p>
								</li>
							</ul>
						</li>';
                }
            }
        }
        echo $before_widget . $before_title . $title . $after_title . '
				<div class="news twitter">
					<ul class="list-unstyled">
						' . $list . '
					</ul>
				</div>' . $after_widget;
    }
示例#9
0
<?php

get_sidebar('footer');
?>


<?php 
$footer_text = boston_get_option('footer_text');
if (!empty($footer_text)) {
    ?>
<footer class="copyrights">
    <div class="copyrights-inner text-center">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                	<p>
                    <?php 
    $allowed_html = wp_kses_allowed_html('post');
    echo wp_kses($footer_text, $allowed_html);
    ?>
                    </p>   
                </div>
            </div>
        </div>
    </div>
</footer>
<?php 
}
?>

<?php 
示例#10
0
            the_permalink();
            ?>
">
				                                    <?php 
            $blog_title_max_length = boston_get_option('blog_title_max_length');
            $title = get_the_title();
            if (!empty($blog_title_max_length) && strlen($title) > $blog_title_max_length) {
                $title = mb_substr($title, 0, $blog_title_max_length) . '...';
            }
            echo esc_html($title);
            ?>
			                                    </a>
		                                    </h2>

		                                    <?php 
            $blog_excerpt_max_length = boston_get_option('blog_excerpt_max_length');
            $excerpt = get_the_excerpt();
            if (!empty($blog_excerpt_max_length) && strlen($excerpt) > $blog_excerpt_max_length) {
                $excerpt = mb_substr($excerpt, 0, $blog_excerpt_max_length) . '...';
            }
            echo '<p>' . $excerpt . '</p>';
            ?>

		                                </div>
		                            </div>
		                            <!-- #post content -->

		                        </article>
		                        <!-- #post -->
		                    <?php 
        } else {
示例#11
0
            } else {
                if (is_singular('post') || is_archive() || is_category() || is_tag() || is_author() || is_search() || is_home()) {
                    echo '<p>';
                    echo boston_get_option('blog_subtitle');
                    echo '</p>';
                } else {
                    if (is_singular('offer')) {
                        echo '<p>';
                        echo boston_get_option('offer_subtitle');
                        echo '</p>';
                    } else {
                        if (is_front_page() || is_home()) {
                            if (!class_exists('ReduxFramework')) {
                                bloginfo('description');
                            } else {
                                echo boston_get_option('blog_subtitle');
                            }
                        } else {
                            echo '<p>';
                            bloginfo('description');
                            echo '</p>';
                        }
                    }
                }
            }
        }
    }
    ?>
				</div>
			</div>
		</div>
示例#12
0
    case 'style1':
        include locate_template('includes/headers/header1.php');
        break;
    case 'style2':
        include locate_template('includes/headers/header2.php');
        break;
    case 'style3':
        include locate_template('includes/headers/header3.php');
        break;
    default:
        include locate_template('includes/headers/header1.php');
        break;
}
if (is_home()) {
    $featured_posts = new WP_Query(array('posts_per_page' => '-1', 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'post_type' => 'post', 'meta_query' => array(array('key' => 'fetured_post', 'value' => 'yes', 'compare' => '='))));
    $featured_visible_items = boston_get_option('featured_visible_items');
    if ($featured_posts->have_posts()) {
        ?>
        <!-- slider -->
        <figure class="slider">
            <div id="main-slider" class="main-slider" data-featured_visible_items="<?php 
        echo esc_attr($featured_visible_items);
        ?>
">
                <?php 
        while ($featured_posts->have_posts()) {
            $featured_posts->the_post();
            ?>
                    <!-- slider item -->
                    <div class="item">
                        <div class="item-image">