Пример #1
0
function add_logo($wp_admin_bar)
{
    $isConsorci = stripos(reactor_option('cpCentre'), "barcelona") ? true : false;
    if ($isConsorci) {
        $args = array('id' => 'consorci', 'title' => '<img src="' . get_stylesheet_directory_uri() . '/custom-tac/imatges/logo_consorci.png">', 'href' => 'http://www.edubcn.cat/ca/', 'parent' => false);
    } else {
        $args = array('id' => 'gencat', 'title' => '<img src="' . get_stylesheet_directory_uri() . '/custom-tac/imatges/logo_gene.png">', 'href' => 'http://www.gencat.cat/ensenyament/', 'parent' => false);
    }
    $wp_admin_bar->add_menu($args);
}
/**
 * Page links 
 * after the loop in page templates
 * 
 * @since 1.0.0
 */
function reactor_do_page_links()
{
    $pagination_type = reactor_option('page_links', 'numbered');
    if (is_page_template('page-templates/front-page.php') && current_theme_supports('reactor-page-links')) {
        $show_page_links = reactor_option('frontpage_page_links', 0);
        if ($show_page_links) {
            reactor_page_links(array('query' => 'frontpage_query', 'type' => $pagination_type));
        }
    } elseif (is_page_template('page-templates/news-page.php') && current_theme_supports('reactor-page-links')) {
        reactor_page_links(array('query' => 'newspage_query', 'type' => $pagination_type));
    } elseif (is_page_template('page-templates/portfolio.php') && current_theme_supports('reactor-page-links')) {
        $filter_type = reactor_option('portfolio_filter_type', 'jquery');
        //if ( 'jquery' != $filter_type ) {
        reactor_page_links(array('query' => 'portfolio_query', 'type' => $pagination_type));
        //}
    } elseif (current_theme_supports('reactor-page-links')) {
        reactor_page_links(array('type' => $pagination_type));
    }
}
    function reactor_do_breadcrumbs()
    {
        if (reactor_option('breadcrumbs', 1)) {
            ?>
			<div id="breadcrumbs">
				<div class="row">
					<div class="<?php 
            reactor_columns(12);
            ?>
">
						<?php 
            reactor_breadcrumbs();
            ?>
					</div><!-- .columns -->
				</div><!-- .row -->
			</div><!-- #breadcrumbs -->
	<?php 
        }
    }
Пример #4
0
function add_dades_centre($wp_admin_bar)
{
    $args = array('id' => 'direccioCentre', 'title' => reactor_option('direccioCentre', 'Direcció centre'), 'parent' => false);
    $wp_admin_bar->add_node($args);
    $args = array('id' => 'telCentre', 'title' => reactor_option('telCentre', '0000000'), 'parent' => false);
    $wp_admin_bar->add_node($args);
    $args = array('id' => 'titularitat', 'title' => 'Centre públic', 'href' => 'http://www10.gencat.net/pls/ense_ensenyam/p01.menu', 'parent' => false);
    $wp_admin_bar->add_node($args);
    /*
    $wp_admin_bar->add_node( $args );
    $args = array(
    	'id'     => 'emailCentre',     // id of the existing child node (New > Post)
    	'title'  => 'bustia@ies-sabadell.cat ', // alter the title of existing node
    	'parent' => false,          // set parent to false to make it a top level (parent) node
    );
    
    $wp_admin_bar->add_node( $args );
    */
}
Пример #5
0
 function get_portfolio_post()
 {
     global $portfolio_query, $json_api;
     $term = get_term_by('ID', 'slug', get_query_var('term'), get_query_var('taxonomy'));
     /** @noinspection PhpParamsInspection */
     $order_by = reactor_option('portfolio_post_orderby', 'date');
     /** @noinspection PhpParamsInspection */
     $order = reactor_option('portfolio_post_order', 'DESC');
     /** @noinspection PhpParamsInspection */
     $number_posts = reactor_option('portfolio_number_posts', 20);
     $paged = get_query_var('paged') ? get_query_var('paged') : 1;
     if (is_tax('portfolio-tag')) {
         $args = array('post_type' => 'portfolio', 'orderby' => $order_by, 'order' => $order, 'portfolio-tag' => $term->name, 'posts_per_page' => $number_posts, 'paged' => $paged);
     } elseif (is_tax('portfolio-category')) {
         $args = array('post_type' => 'portfolio', 'orderby' => $order_by, 'order' => $order, 'portfolio-category' => $term->name, 'posts_per_page' => $number_posts, 'paged' => $paged);
     } else {
         $args = array('post_type' => 'portfolio', 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number_posts, 'paged' => $paged, 'p' => $json_api->query->id, 'name' => $json_api->query->slug);
     }
     /*
      * todo thumbnails next and previous posts
      */
     $portfolio_query = new WP_Query($args);
     return array('posts' => $portfolio_query->posts);
 }
Пример #6
0
<?php

/**
 * Template Name: News Page
 *
 * @package Reactor
 * @subpackge Page-Templates
 * @since 1.0.0
 */
update_option('current_page_template', 'news-page');
?>

<?php 
// get the options
$slider_category = reactor_option('newspage_slider_category', '');
?>

<?php 
get_header();
?>

	<div id="primary" class="site-content">

		<?php 
reactor_content_before();
?>

		<div id="content" role="main">
			<div class="row">

				<div class="<?php 
Пример #7
0
/**
 * Mobile nav
 * in header.php
 * 
 * @since 1.0.0
 */
function reactor_do_mobile_nav()
{
    if (reactor_option('mobile_menu', 1) && has_nav_menu('main-menu')) {
        ?>
 
		<nav id="mobile-menu" class="show-for-small" role="navigation">
			<div class="section-container accordion" data-section="accordion" data-options="one_up:false">
				<?php 
        reactor_main_menu();
        ?>
			</div>
		</nav>
<?php 
    }
}
Пример #8
0
 function reactor_side_menu($nav_args = '')
 {
     global $post;
     // get the menu option from customizer
     $side_nav_type = reactor_option('side_nav_type', 'accordion');
     // set the menu containers
     $before = 'accordion' == $side_nav_type ? '<div class="section-container accordion" data-section="accordion">' : '<ul class="side-nav">';
     $after = 'accordion' == $side_nav_type ? '</div>' : '</ul>';
     // default args
     $defaults = array('show_home' => true, 'home_text' => __('&larr; Home', 'reactor'), 'before' => $before, 'after' => $after);
     $nav_args = apply_filters('reactor_side_menu', wp_parse_args($nav_args, $defaults));
     // set the menu depth and walker
     $depth = 'accordion' == $side_nav_type ? 2 : 1;
     $side_nav_walker = new Side_Menu_walker();
     $walker = 'side_nav' == $side_nav_type ? '' : $side_nav_walker;
     // wp_list_pages args
     $args = array('title_li' => '', 'depth' => $depth, 'sort_column' => 'menu_order', 'echo' => 0, 'walker' => $walker);
     // setup the page list based on ancestor id or post id
     if ($post->post_parent) {
         $ancestors = get_post_ancestors($post->ID);
         $root = count($ancestors) - 1;
         $args['child_of'] = $ancestors[$root];
     } else {
         $args['child_of'] = $post->ID;
     }
     // generate the page list
     $children = wp_list_pages($args);
     // add the home link if args is true and using side nav
     if ($nav_args['show_home'] == true && 'side_nav' == $side_nav_type) {
         $nav_args['before'] .= '<li><a href="' . get_home_url() . '">' . $nav_args['home_text'] . '</a></li><li class="divider"></li>';
     }
     // display the menu if there are subpages
     if ($children) {
         $output = $nav_args['before'] . $children . $nav_args['after'];
         echo $output;
     }
 }
Пример #9
0
<?php

/**
 * Template Name: Front Page
 *
 * @package Reactor
 * @subpackge Page-Templates
 * @since 1.0.0
 */
?>

<?php 
// get the options
$slider_category = reactor_option('frontpage_slider_category', '');
?>

<?php 
get_header();
?>

	<div id="primary" class="site-content">
    
    	<?php 
reactor_content_before();
?>
  
        <div class="row">
          	<div class="<?php 
reactor_columns(12);
?>
">
Пример #10
0
/**
 * Footer links and site info
 * in footer.php
 * 
 * @since 1.0.0
 */
function reactor_do_footer_content()
{
    ?>
	<div class="site-info">
		<div class="row">
        
			<div class="<?php 
    reactor_columns(6);
    ?>
">
			<?php 
    if (function_exists('reactor_footer_links')) {
        ?>
				<nav class="footer-links" role="navigation">
					<?php 
        reactor_footer_links();
        ?>
				</nav><!-- #footer-links -->
			<?php 
    }
    ?>
			</div><!--.columns -->
                    
			<div class="<?php 
    reactor_columns(6);
    ?>
">
				<div id="colophon">                      
					<?php 
    if (reactor_option('footer_siteinfo')) {
        echo reactor_option('footer_siteinfo');
    } else {
        ?>
					<span class="copyright">&copy; <?php 
        echo date_i18n('Y');
        ?>
 <?php 
        bloginfo('name');
        ?>
. All rights reserved.</span>
					<?php 
    }
    ?>
				</div><!-- #colophon -->
			</div><!-- .columns -->
            
		</div><!-- .row -->
	</div><!-- #site-info -->
<?php 
}
/**
 * Footer links and site info
 * in footer.php
 * 
 * @since 1.0.0
 */
function reactor_do_footer_content()
{
    ?>
	<div class="site-info">
		<div class="row">
        
			<div class="<?php 
    reactor_columns(6);
    ?>
">
			<?php 
    if (function_exists('reactor_footer_links')) {
        ?>
				
				<div id="colophon">                      
					<?php 
        if (reactor_option('footer_siteinfo')) {
            echo reactor_option('footer_siteinfo');
        } else {
            ?>
					<span class="copyright">&copy;<?php 
            echo date_i18n('Y');
            ?>
 <?php 
            bloginfo('name');
            ?>
 </span>
                        
					<?php 
        }
        ?>
				</div><!-- #colophon -->
			<?php 
    }
    ?>
			</div><!--.columns -->
                    
			<div class="<?php 
    reactor_columns(6);
    ?>
">
				<div id="credit"><span class="copyright">Website Designed & Developed by <a href="http://www.arsenalstudios.com" target="_blank">Arsenal Studios</a></span></div><!-- #credit -->
			</div><!-- .columns -->
            
		</div><!-- .row -->
	</div><!-- #site-info -->
<?php 
}
Пример #12
0
<head>
    <?php 
include "style.php";
?>

    <link href='https://fonts.googleapis.com/css?family=Oswald:400,300' rel='stylesheet' type='text/css'>
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">

    <?php 
wp_head();
reactor_head();
?>

    <?php 
$favicon = reactor_option("favicon_image");
if (!$favicon) {
    $favicon = get_stylesheet_directory_uri() . "/favicon.ico";
}
?>
    <link rel="shortcut icon" href="<?php 
echo $favicon;
?>
"/>
</head>

<body <?php 
body_class();
?>
>
    <?php 
Пример #13
0
    public function widget($args, $instance)
    {
        // Saved widget options
        $title = $instance['title'];
        echo $args['before_widget'];
        if (!empty($title)) {
            echo '<h4 class="widget-title">' . $title . '</h4>';
        }
        $contacte = strstr(reactor_option('emailCentre'), '@') ? "mailto:" . reactor_option('emailCentre') : reactor_option('emailCentre');
        ?>
            <div class="targeta_id_centre row">
		<?php 
        if (reactor_option('logo_image')) {
            if (reactor_option('logo_inline')) {
                $class_logo = "logo_inline";
                $class_addr = "addr-centre";
                $amplada = "6";
            } else {
                $class_logo = "logo_clear";
                $class_addr = "logo_clear";
                $amplada = "12";
            }
            ?>
			<div class="<?php 
            reactor_columns(array($amplada, 12));
            echo " " . $class_logo;
            ?>
 hide-for-small"> 
				<img src="<?php 
            echo reactor_option('logo_image');
            ?>
">					
			</div> 
		<?php 
        } else {
            $amplada = "12";
            $class = "no_logo";
        }
        ?>
                
                <?php 
        list($postal_code, $locality) = explode(" ", reactor_option("cpCentre"), 1);
        ?>
            
		<div class="<?php 
        reactor_columns($amplada);
        echo " " . $class_addr;
        ?>
 ">
                    <div class="vcard">
                        <span id="tar-nomCentre"><?php 
        echo reactor_option('nomCanonicCentre');
        ?>
</span>
                        <div class="adr">
                            <span class="street-address"><?php 
        echo reactor_option('direccioCentre');
        ?>
</span><br>
                            <span class="postal-code"><?php 
        echo trim($postal_code);
        ?>
</span> 
                            <span class="locality"><?php 
        echo trim($locality);
        ?>
</span>  
                            <span  class="region" title="Catalunya">Catalunya</span>
                            <span  class="country-name">Espanya</span>
                            <div class="tel">
                                <span><?php 
        echo reactor_option('telCentre');
        ?>
</span>
                            </div>
                            <a id="tar-mapa" href="<?php 
        echo reactor_option('googleMaps');
        ?>
">mapa</a> 
                            <span class="pipe" >|</span> 
                            <a id="tar-contacte" href="<?php 
        echo $contacte;
        ?>
">contacte</a>
                            
                        </div>		 
                    </div>	
		 </div>		 
            </div>
  	<?php 
        echo $args['after_widget'];
    }
Пример #14
0
<?php

/**
 * The loop for displaying posts on the news page template
 *
 * @package Reactor
 * @subpackage loops
 * @since 1.0.0
 */
?>

<?php 
// the get options
$number_posts = reactor_option('newspage_number_posts', 10);
$post_columns = reactor_option('newspage_post_columns', 2);
?>

					<?php 
// start post the loop
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$args = array('post_type' => 'post', 'posts_per_page' => $number_posts, 'paged' => $paged);
global $newspage_query;
$newspage_query = new WP_Query($args);
?>
                    
				    <?php 
if ($newspage_query->have_posts()) {
    ?>

                    	<?php 
    while ($newspage_query->have_posts()) {
/**
 * Single post nav 
 * in single.php
 * 
 * @since 1.0.0
 */
function reactor_do_nav_single()
{
    if (is_single()) {
        $exclude = reactor_option('frontpage_exclude_cat', 1) ? reactor_option('frontpage_post_category', '') : '';
        ?>
        <nav class="nav-single">
            <span class="nav-previous alignleft">
            <?php 
        previous_post_link('%link', '<span class="meta-nav">' . _x('&larr;', 'Previous post link', 'reactor') . '</span> %title', false, $exclude);
        ?>
            </span>
            <span class="nav-next alignright">
            <?php 
        next_post_link('%link', '%title <span class="meta-nav">' . _x('&rarr;', 'Next post link', 'reactor') . '</span>', false, $exclude);
        ?>
            </span>
        </nav><!-- .nav-single -->
<?php 
    }
}
Пример #16
0
function show_logo()
{
    echo "<div id='login_logo'><img src=" . reactor_option('logo_image') . ">" . "<h1>" . reactor_option('nomCanonicCentre') . "</h1></div>";
}
Пример #17
0
 * The loop for displaying portfolio posts on the portfolio page template
 *
 * @package Reactor
 * @subpackage loops
 * @since 1.0.0
 */
?>

<?php 
// get the options
$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
$filter_type = reactor_option('portfolio_filter_type', 'jquery');
$post_columns = reactor_option('portfolio_post_columns', 4);
$order_by = reactor_option('portfolio_post_orderby', 'date');
$order = reactor_option('portfolio_post_order', 'DESC');
$number_posts = reactor_option('portfolio_number_posts', 20);
?>

					<?php 
// start the portfolio loop
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
if (is_tax('portfolio-tag')) {
    $args = array('post_type' => 'portfolio', 'orderby' => $order_by, 'order' => $order, 'portfolio-tag' => $term->name, 'posts_per_page' => $number_posts, 'paged' => $paged);
} elseif (is_tax('portfolio-category')) {
    $args = array('post_type' => 'portfolio', 'orderby' => $order_by, 'order' => $order, 'portfolio-category' => $term->name, 'posts_per_page' => $number_posts, 'paged' => $paged);
} else {
    $args = array('post_type' => 'portfolio', 'orderby' => $order_by, 'order' => $order, 'posts_per_page' => $number_posts, 'paged' => $paged);
}
global $portfolio_query;
$portfolio_query = new WP_Query($args);
?>
Пример #18
0
<?php

/**
 * The sidebar template containing the main widget area
 *
 * @package Reactor
 * @subpackge Templates
 * @since 1.0.0
 */
// get the page layout
wp_reset_postdata();
/** @noinspection PhpParamsInspection */
$default = reactor_option('page_layout', '2c-l');
/** @noinspection PhpParamsInspection */
$layout = reactor_option('', $default, '_template_layout');
?>

<?php 
// if layout has one sidebar and the sidebar is active
if (is_active_sidebar('sidebar') && '1c' != $layout) {
    ?>

	<?php 
    reactor_sidebar_before();
    ?>

	<div id="sidebar" class="sidebar <?php 
    reactor_columns('', true, true, 1);
    ?>
"
	     role="complementary" data-ng-controller="SidebarCtrl">
Пример #19
0
/**
 * Post footer comments link 
 * in all formats
 * 
 * @since 1.0.0
 */
function reactor_do_post_footer_comments_link()
{
    if (is_page_template('page-templates/front-page.php')) {
        $comments_link = reactor_option('frontpage_comment_link', 1);
    } elseif (is_page_template('page-templates/news-page.php')) {
        $comments_link = reactor_option('newspage_comment_link', 1);
    } else {
        $comments_link = reactor_option('comment_link', 1);
    }
    if (comments_open() && $comments_link) {
        ?>
		<div class="comments-link">
			<i class="icon social foundicon-chat" title="Comments"></i>
			<?php 
        comments_popup_link('<span class="leave-comment">' . __('Leave a Comment', 'reactor') . '</span>', __('1 Comment', 'reactor'), __('% Comments', 'reactor'));
        ?>
		</div><!-- .comments-link -->
    <?php 
    }
}
Пример #20
0
?>

<?php 
// get the options
/** @noinspection PhpParamsInspection */
$post_category = reactor_option('frontpage_post_category', '');
if (-1 == $post_category) {
    $post_category = '';
}
// fix customizer -1
/** @noinspection PhpParamsInspection */
$number_posts = reactor_option('frontpage_number_posts', 3);
/** @noinspection PhpParamsInspection */
$post_columns = reactor_option('frontpage_post_columns', 3);
/** @noinspection PhpParamsInspection */
$page_links = reactor_option('frontpage_page_links', 0);
?>

<?php 
// start the loop
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$args = array('post_type' => 'post', 'cat' => $post_category, 'posts_per_page' => $number_posts, 'ignore_sticky_posts' => 1, 'paged' => $paged);
global $frontpage_query;
$frontpage_query = new WP_Query($args);
?>

<?php 
if ($frontpage_query->have_posts()) {
    ?>

	<?php 
Пример #21
0
<?php

/**
 * The sidebar template containing the front page widget area
 *
 * @package Reactor
 * @subpackge Templates
 * @since 1.0.0
 */
?>

	<?php 
// get the front page layout
wp_reset_postdata();
$layout = reactor_option('', '1c', '_template_layout');
?>
    
    <?php 
// if front page has one sidebar and the sidebar is active
if (is_active_sidebar('sidebar-frontpage') && '1c' != $layout) {
    ?>
    
    <?php 
    reactor_sidebar_before();
    ?>
    
        <div id="sidebar-frontpage" class="sidebar <?php 
    reactor_columns('', true, true, 1);
    ?>
" role="complementary">
            <?php 
Пример #22
0
/**
 * 3. Logo title attribute text
 *
 * @since 1.0.0
 */
function reactor_login_logo_title()
{
    if (reactor_option('login_logo_title')) {
        return reactor_option('login_logo_title');
    }
}
Пример #23
0
if (strlen(trim(get_the_content()))) {
    get_template_part('post-formats/format', 'page');
}
wp_reset_postdata();
$paged = get_query_var('page') ? get_query_var('page') : 1;
//Es necessari utilitzar $wp_query per tenir paginació
$temp = $wp_query;
$wp_query = null;
//Articles. No es pot establir la categoria directament perquè perdem els stickys
$args = array('post_type' => 'post', 'posts_per_page' => $number_posts, 'paged' => $paged);
$wp_query = new WP_Query($args);
//action: filter_by_categoria
$posts_per_filan = reactor_option('frontpage_posts_per_fila_n', 2);
if ($paged == 1) {
    $posts_per_fila1 = reactor_option('frontpage_posts_per_fila_1', 2);
    $posts_per_fila2 = reactor_option('frontpage_posts_per_fila_2', 2);
} else {
    $posts_per_fila1 = $posts_per_fila2 = $posts_per_filan;
}
reactor_loop_before();
get_template_part('loops/loop', 'taxonomy');
reactor_loop_after();
wp_reset_postdata();
$wp_query = $temp;
reactor_inner_content_after();
?>
        </div><!-- .columns --><!--Contingut central -->
        <!-- Barra esquerra si aplica -->
        <div class="show-for-small">
            <a id='barra_esquerra'></a>		
            <?php 
?>

<article id="post-<?php 
the_ID();
?>
" <?php 
post_class();
?>
>

  <div class="entry-body">
      
    <div>
      
      <?php 
$link_titles = reactor_option('frontpage_link_titles', 0);
if (is_page_template('page-templates/front-page.php') && !$link_titles && !wp_is_mobile()) {
    the_post_thumbnail();
} elseif (!wp_is_mobile()) {
    ?>

        <a href="<?php 
    the_permalink();
    ?>
" rel="bookmark" title="<?php 
    the_title_attribute();
    ?>
"><?php 
    the_post_thumbnail();
    ?>
</a>
Пример #25
0
<style>
<?php 
global $colors_nodes;
$paleta = reactor_option('paleta_colors', 'blaus');
$color_primary = $colors_nodes[$paleta]["primary"];
$color_secondary = $colors_nodes[$paleta]["secondary"];
$color_footer = isset($colors_nodes[$paleta]["footer"]) ? $colors_nodes[$paleta]["footer"] : $color_secondary;
$color_link = isset($colors_nodes[$paleta]["link"]) ? $colors_nodes[$paleta]["link"] : $color_secondary;
$color_icon22 = isset($colors_nodes[$paleta]["icon22"]) ? $colors_nodes[$paleta]["icon22"] : $color_secondary;
$color_calendar = isset($colors_nodes[$paleta]["calendar"]) ? $colors_nodes[$paleta]["calendar"] : $color_secondary;
$color_mobile = isset($colors_nodes[$paleta]["mobile"]) ? $colors_nodes[$paleta]["mobile"] : $color_secondary;
?>
    .box-title{
       background-color:<?php 
echo $color_primary;
?>
    }
    .box-description{
        background-color:<?php 
echo $color_secondary;
?>
    }
    #icon-11, #icon-23{
        background-color:<?php 
echo $color_secondary;
?>
    }
    #icon-21, #icon-13{
        background-color:<?php 
echo $color_primary;
?>
 * The template for displaying posts on the portfolio page,
 * portfolio-single, taxonomy-portfolio-category and taxonomy-portfolio-tag
 *
 * @package Reactor
 * @subpackage Post-Formats
 * @since 1.0.0
 */
?>

<?php 
/** @noinspection PhpParamsInspection */
$show_titles = reactor_option('portfolio_show_titles', 1);
/** @noinspection PhpParamsInspection */
$link_titles = reactor_option('portfolio_link_titles', 1);
/** @noinspection PhpParamsInspection */
$post_meta = reactor_option('portfolio_post_meta', 0);
?>

<article id="post-<?php 
the_ID();
?>
" <?php 
post_class();
?>
>
	<div class="entry-body">
		<header class="entry-header">
			<?php 
if (has_post_thumbnail() && !is_single()) {
    ?>
Пример #27
0
/**
 * Reactor Columns
 * a function to set grid columns based on selected layout
 * can also pass a set number of columns to the function
 *
 * @package Reactor
 * @author Anthony Wilhelm (@awshout / anthonywilhelm.com)
 * @since 1.0.0
 * @license GNU General Public License v2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 */
function reactor_columns($columns = '', $echo = true, $sidebar = false, $sidebar_id = null)
{
    // if array of 2 numbers is passed to the function
    if ($columns && is_array($columns)) {
        echo 'large-' . intval($columns[0]) . ' small-' . intval($columns[1]) . ' columns';
        return;
    } elseif ($columns) {
        echo 'large-' . intval($columns) . ' small-12 columns';
        return;
    }
    // get the template layout from meta
    $default = reactor_option('page_layout', '2c-l');
    $layout = reactor_option('', $default, '_template_layout');
    if (is_page_template('page-templates/side-menu.php')) {
        $layout = 'side-menu';
    }
    // check if tumblog icons are used in blog
    $tumblog = reactor_option('tumblog_icons', false);
    // else check if columns are for a sidebar
    if (true == $sidebar) {
        // sidebar columns based on layout
        switch ($layout) {
            case '1c':
                $classes[] = '';
                break;
            case '3c-l':
            case '3c-r':
            case '3c-c':
                $classes[] = 'large-3';
                break;
            case 'side-menu':
                if ('accordion' == reactor_option('side_nav_type', 'accordion')) {
                    $classes[] = 'large-3';
                } elseif ('side_nav' == reactor_option('side_nav_type', 'accordion')) {
                    $classes[] = 'large-2';
                }
                break;
            default:
                // 4 is the default number of columns for 1 sidebar
                $classes[] = 'large-4';
                break;
        }
        // pull the content above left sidebar on small screens
        if ('3c-r' == $layout) {
            $classes[] = 'pull-6';
        } elseif ('3c-c' == $layout && 1 == $sidebar_id) {
            $classes[] = 'pull-6';
        } elseif ('2c-r' == $layout) {
            $classes[] = 'pull-8';
        }
        // else apply columns based on template layout or meta
    } else {
        // number of columns for main content based on layout
        switch ($layout) {
            case '1c':
                // subtract 1 and offset by 1 if using tumblog icons
                if ($tumblog && is_home()) {
                    $classes[] = 'large-11';
                    $classes[] = 'large-offset-1';
                } else {
                    $classes[] = 'large-12';
                }
                break;
            case '3c-l':
            case '3c-r':
            case '3c-c':
                // subtract 1 and offset by 1 if using tumblog icons
                if ($tumblog && is_home()) {
                    $classes[] = 'large-5';
                    $classes[] = 'large-offset-1';
                } else {
                    $classes[] = 'large-6';
                }
                break;
            case 'side-menu':
                if ('accordion' == reactor_option('side_nav_type', 'accordion')) {
                    $classes[] = 'large-9';
                } elseif ('side_nav' == reactor_option('side_nav_type', 'accordion')) {
                    $classes[] = 'large-10';
                }
                break;
            default:
                /* 8 is the default number of columns for a page with 1 sidebar
                			subtract 1 and offset by 1 if using tumblog icons */
                if ($tumblog && is_home()) {
                    $classes[] = 'large-7';
                    $classes[] = 'large-offset-1';
                } else {
                    $classes[] = 'large-8';
                }
                break;
        }
        // push columns for left sidebars
        switch ($layout) {
            case '3c-r':
                $classes[] = 'push-6';
                break;
            case '3c-c':
                $classes[] = 'push-3';
                break;
            case '2c-r':
                $classes[] = 'push-4';
                break;
        }
    }
    //always add the columns class
    $classes[] = 'columns';
    // remove empty values
    $classes = array_filter($classes);
    // add spaces
    $columns = implode(' ', array_map('esc_attr', $classes));
    // echo classes unless echo false
    if (false == $echo) {
        return apply_filters('reactor_content_cols', $columns);
    } else {
        echo apply_filters('reactor_content_cols', $columns);
    }
}
Пример #28
0
/**
 * 22. Exclude Front Page Posts
 * If option is set in customizer to exlude front page posts
 * then remove them from the main query
 *
 * @since 1.0.0
 */
function exclude_category($query)
{
    $exclude = reactor_option('frontpage_exclude_cat', 1) ? -reactor_option('frontpage_post_category', '') : '';
    if ($query->is_home() && $query->is_main_query()) {
        $query->set('cat', $exclude);
    }
}
Пример #29
0
/**
 * Create an array of fonts to be enqueued
 *
 * @since 1.0.0
 */
function reactor_typography_google_fonts()
{
    $all_google_fonts = array_keys(reactor_typography_get_google_fonts());
    // Get the font face for each option and put it in an array
    $content_font = reactor_option('content_font', "'Helvetica Neue', Helvetica, Arial, sans-serif");
    $title_font = reactor_option('title_font', "'Helvetica Neue', Helvetica, Arial, sans-serif");
    $selected_fonts = array($content_font, $title_font);
    // Remove any duplicates in the list
    $selected_fonts = array_unique($selected_fonts);
    // Check each of the unique fonts against the defined Google fonts
    // If it is a Google font, go ahead and call the function to enqueue it
    foreach ($selected_fonts as $font) {
        if (in_array($font, $all_google_fonts)) {
            reactor_typography_enqueue_google_font($font);
        }
    }
}
Пример #30
0
<?php

/**
 * Template Name: Portfolio
 *
 * @package Reactor
 * @subpackge Page-Templates
 * @since 1.0.0
 */
?>

<?php 
// get the options
$filter_type = reactor_option('portfolio_filter_type', 'jquery');
$quicksand = 'jquery' != $filter_type ? false : true;
?>

<?php 
get_header();
?>

	<div id="primary" class="site-content">
    
    	<?php 
reactor_content_before();
?>
    
        <div id="content" role="main">
        	<div class="row">
                <div class="<?php 
reactor_columns();