示例#1
0
function cactus_custom_posts_per_page($query)
{
    $course_per_page = $event_per_page = '';
    $post_per_page = get_option('posts_per_page');
    if (function_exists('cop_get')) {
        $event_per_page = cop_get('u_event_settings', 'uevent-per-page');
        $course_per_page = cop_get('u_course_settings', 'ucourse-per-page');
    }
    $woo_per_page = ot_get_option('woo_per_page');
    if ($woo_per_page == '') {
        $woo_per_page = $post_per_page;
    }
    if ($event_per_page == '') {
        $event_per_page = $post_per_page;
    }
    if ($course_per_page == '') {
        $course_per_page = $post_per_page;
    }
    if (isset($query->query_vars['post_type']) && $query->is_main_query()) {
        switch ($query->query_vars['post_type']) {
            case 'u_event':
                // Post Type named 'Event'
                $query->query_vars['posts_per_page'] = $event_per_page;
                break;
            case 'u_course':
                // Post Type named 'Course'
                $query->query_vars['posts_per_page'] = $course_per_page;
                break;
            case 'productgf':
                // Post Type named 'Product'
                $query->query_vars['posts_per_page'] = $woo_per_page;
                break;
            default:
                break;
        }
    }
    if (is_tax('u_course_cat')) {
        $query->query_vars['posts_per_page'] = $course_per_page;
    }
    if (is_tax('u_event_cat')) {
        $query->query_vars['posts_per_page'] = $event_per_page;
    }
    return $query;
}
 target="_blank"<?php 
    }
    ?>
><?php 
    _e($u_textsub, 'cactusthemes');
    ?>
</a>
            <?php 
}
?>
        </div>
		  <?php 
if (function_exists('cop_get')) {
    $event_style = cop_get('u_event_settings', 'uevent-related');
    $reletd_number = cop_get('u_event_settings', 'uevent-rel-number');
    $event_layout = cop_get('u_event_settings', 'u-event-layout');
}
if ($event_style == 'tags') {
    $posttags = get_the_terms(get_the_ID(), 'u_event_tags');
    $tags_event = array();
    if ($posttags) {
        foreach ($posttags as $tag) {
            $tags = $tag->slug;
            array_push($tags_event, $tags);
        }
    }
    if (count($tags_event) > 1) {
        $texo = array('relation' => 'OR');
        foreach ($tags_event as $iterm) {
            $texo[] = array('taxonomy' => 'u_event_tags', 'field' => 'slug', 'terms' => $iterm);
        }
if ($filter != 1) {
    ?>
                        	<div class="filter-cat">
                            	<?php 
    $pageURL = 'http';
    if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
        $pageURL .= "s";
    }
    $pageURL .= "://";
    if ($_SERVER["SERVER_PORT"] != "80") {
        $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    } else {
        $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
    }
    if (function_exists('cop_get')) {
        $slug_pro = cop_get('u_project_settings', 'uproject-slug');
    }
    if ($slug_pro == '') {
        $slug_pro = 'project';
    }
    $project_cat = home_url() . '/' . $slug_pro . '/';
    $selected = '';
    $bg_cr = '';
    if (strpos($pageURL, $project_cat) !== false) {
        $bg_cr = 'style="background-color: #666666;border-color: #666666; color:#fff"';
        $selected = 'selected="selected"';
    }
    ?>
                            	<a href="<?php 
    echo $project_cat;
    ?>
示例#4
0
<?php

if (function_exists('cop_get')) {
    $slug_pt = cop_get('u_event_settings', 'uevent-slug');
    $filter = cop_get('u_event_settings', 'uevent-filter');
}
if ($slug_pt == '') {
    $slug_pt = 'event';
}
if ($filter == 1) {
    ct_filter_bar($taxono = 'u_event_cat', $slug_pt);
}
?>
<div class="event-listing un-grid-listing">
    <div class="grid-listing-wrap">
        <div class="grid-listing">
            <?php 
//global $the_query;
if (have_posts()) {
    while (have_posts()) {
        the_post();
        //loop here
        get_template_part('u-event/grid', 'list-item');
        ?>
              	<?php 
    }
    ?>
            <?php 
}
?>
        </div>
示例#5
0
<?php

/*
 *  Single Event
 */
get_header();
$content_padding = get_post_meta(get_the_ID(), 'course-ctpadding', true);
$course_layout = get_post_meta(get_the_ID(), 'course-sidebar', true);
if (function_exists('cop_get') && $course_layout == 'def') {
    $course_layout = cop_get('u_course_settings', 'u-course-layout');
}
?>
	<?php 
get_template_part('header', 'heading');
?>
    <div id="body">
    	<div class="container">
        	<?php 
if ($content_padding != 'off') {
    ?>
        	<div class="content-pad-3x">
            <?php 
}
?>
                <div class="row">
                    <div id="content" class="<?php 
echo $course_layout != 'full' ? 'col-md-9' : 'col-md-12';
echo $course_layout == 'left' ? " revert-layout" : "";
?>
">
                    <?php 
示例#6
0
global $wp;
if (get_option('permalink_structure') != '') {
    $curent_url = home_url($wp->request);
    if (function_exists('qtrans_getLanguage') && qtrans_getLanguage() != '') {
        $curent_url = '//' . $_SERVER["HTTP_HOST"] . $_SERVER['REDIRECT_URL'];
    }
} else {
    $query_string = $wp->query_string;
    if (isset($_GET['lang'])) {
        $query_string = $wp->query_string . '&lang=' . $_GET['lang'];
    }
    $curent_url = add_query_arg($query_string, '', home_url($wp->request));
}
if (function_exists('cop_get')) {
    $filter_bar = cop_get('u_member_settings', 'u-member-filter');
    $slug_mb = cop_get('u_member_settings', 'umember-slug');
    if ($slug_mb == '') {
        $slug_mb = 'member';
    }
}
?>
                <div class="row">
                    <div id="content" class="<?php 
echo $layout != 'full' && $layout != 'true-full' ? 'col-md-9' : 'col-md-12';
echo $layout == 'left' ? " revert-layout" : "";
?>
">
                    <?php 
if ($filter_bar != 'off') {
    ?>
	
示例#7
0
//overwrite page title
get_template_part('header', 'heading');
?>
    <div id="body">
    	<div class="container">
        	<div class="content-pad-3x">
            <?php 
$date_format = get_option('date_format');
global $post;
?>
             	<div class="row">
                    <div id="content" class="col-md-9">
                    <?php 
if (function_exists('cop_get')) {
    $slug_pt = cop_get('u_course_settings', 'ucourse-slug');
    $filter = cop_get('u_course_settings', 'ucourse-filter');
}
if ($slug_pt == '') {
    $slug_pt = 'course';
}
if ($filter == 1) {
    ct_filter_bar($taxono = 'u_course_cat', $slug_pt);
    ?>
                            <style type="text/css">.courses-list{ padding-top:0}</style>
                            <?php 
}
?>
                        <div class="courses-list">
                         <?php 
if (have_posts()) {
    $query_count = 0;
    _e('Sold Out', 'cactusthemes');
    ?>
</span>
            <?php 
}
?>
        </div>
        
        
           <?php 
$course_layout = get_post_meta(get_the_ID(), 'course-sidebar', true);
if (function_exists('cop_get') && $course_layout == 'def') {
    $course_layout = cop_get('u_course_settings', 'u-course-layout');
}
if (function_exists('cop_get')) {
    $reletd_number = cop_get('u_course_settings', 'ucourse-rel-number');
}
$post_cat = get_the_terms(get_the_ID(), 'u_course_cat');
$cat_course = array();
if ($post_cat) {
    foreach ($post_cat as $cat) {
        $cats = $cat->slug;
        array_push($cat_course, $cats);
    }
}
if (count($cat_course) > 1) {
    $texo = array('relation' => 'OR');
    foreach ($cat_course as $iterm) {
        $texo[] = array('taxonomy' => 'u_course_cat', 'field' => 'slug', 'terms' => $iterm);
    }
} else {
示例#9
0
<?php

/*
 *  Single Member
 */
get_header();
$content_padding = get_post_meta(get_the_ID(), 'member-ctpadding', true);
$layout = get_post_meta(get_the_ID(), 'member-sidebar', true);
if (function_exists('cop_get') && $layout == '') {
    $layout = cop_get('u_member_settings', 'u-member-layout');
}
?>
	<?php 
get_template_part('header', 'heading');
?>
    <div id="body">
    	<div class="container">
        	<?php 
if ($content_padding != 'off') {
    ?>
        	<div class="content-pad-3x">
            <?php 
}
?>
                <div class="row">
                    <div id="content" class="<?php 
echo $layout != 'full' ? 'col-md-9' : 'col-md-12';
echo $layout == 'left' ? " revert-layout" : "";
?>
">
                    <?php 
示例#10
0
        echo ', ';
    }
}
?>
                        </div>
                        <ul class="list-inline social-light">
							<?php 
cactus_social_share();
?>
                        </ul>
                    </div>
                    
				<?php 
if (function_exists('cop_get')) {
    $reletd_number = cop_get('u_project_settings', 'uproject-rel-number');
    $project_layout = cop_get('u_project_settings', 'u-project-layout');
}
$post_cat = get_the_terms(get_the_ID(), 'u_project_cat');
$cat_event = array();
if ($post_cat) {
    foreach ($post_cat as $cat) {
        $cats = $cat->slug;
        array_push($cat_event, $cats);
    }
}
if (count($cat_event) > 1) {
    $texo = array('relation' => 'OR');
    foreach ($cat_event as $iterm) {
        $texo[] = array('taxonomy' => 'u_project_cat', 'field' => 'slug', 'terms' => $iterm);
    }
} else {