function thinkup_input_sliderclass($classes)
{
    global $thinkup_homepage_sliderswitch;
    global $thinkup_homepage_sliderpresetwidth;
    global $post;
    if (!empty($post->ID)) {
        $_thinkup_meta_slider = get_post_meta($post->ID, '_thinkup_meta_slider', true);
        $_thinkup_meta_sliderpage = get_post_meta($post->ID, '_thinkup_meta_sliderimages', true);
    }
    if (is_front_page() or thinkup_check_ishome()) {
        if (empty($thinkup_homepage_sliderswitch) or $thinkup_homepage_sliderswitch == 'option1') {
            if (empty($thinkup_homepage_sliderpresetwidth) or $thinkup_homepage_sliderpresetwidth == '1') {
                $classes[] = 'slider-full';
            } else {
                $classes[] = 'slider-boxed';
            }
        }
    } else {
        if (!is_front_page() and !thinkup_check_ishome() and !is_archive() and !thinkup_check_isblog() and $_thinkup_meta_slider == 'on') {
            if (is_array($_thinkup_meta_sliderpage)) {
                if ($_thinkup_meta_sliderpage['full_width'] == 'on') {
                    $classes[] = 'slider-full';
                } else {
                    $classes[] = 'slider-boxed';
                }
            }
        }
    }
    return $classes;
}
function thinkup_title_select()
{
    global $post;
    if (is_page()) {
        printf(__('%s', 'sento'), get_the_title());
    } elseif (is_attachment()) {
        printf(__('Blog Post Image: ', 'sento') . '%s', esc_attr(get_the_title($post->post_parent)));
    } else {
        if (is_single()) {
            printf(__('%s', 'sento'), get_the_title());
        } else {
            if (is_search()) {
                printf(__('Search Results: ', 'sento') . '%s', get_search_query());
            } else {
                if (is_404()) {
                    printf(__('Page Not Found', 'sento'));
                } else {
                    if (is_category()) {
                        printf(__('Category Archives: ', 'sento') . '%s', single_cat_title('', false));
                    } elseif (is_tag()) {
                        printf(__('Tag Archives: ', 'sento') . '%s', single_tag_title('', false));
                    } elseif (is_author()) {
                        the_post();
                        printf(__('Author Archives: ', 'sento') . '%s', get_the_author());
                        rewind_posts();
                    } elseif (is_day()) {
                        printf(__('Daily Archives: ', 'sento') . '%s', get_the_date());
                    } elseif (is_month()) {
                        printf(__('Monthly Archives: ', 'sento') . '%s', get_the_date('F Y'));
                    } elseif (is_year()) {
                        printf(__('Yearly Archives: ', 'sento') . '%s', get_the_date('Y'));
                    } elseif (is_post_type_archive('portfolio')) {
                        printf(__('Portfolio', 'sento'));
                    } elseif (is_post_type_archive('client')) {
                        printf(__('Our Clients', 'sento'));
                    } elseif (is_post_type_archive('team')) {
                        printf(__('Our Team', 'sento'));
                    } elseif (is_post_type_archive('testimonial')) {
                        printf(__('Customer Testimonials', 'sento'));
                    } elseif (is_post_type_archive('product') and function_exists('thinkup_woo_titleshop_archive')) {
                        printf(thinkup_woo_titleshop_archive());
                    } elseif (thinkup_check_isblog()) {
                        printf(__('Blog', 'sento'));
                    } elseif (is_tax()) {
                        echo get_queried_object()->name;
                    } else {
                        printf(__('%s', 'sento'), get_the_title());
                    }
                }
            }
        }
    }
}
function thinkup_frontscripts()
{
    // Add jQuery library.
    wp_enqueue_script('jquery');
    // Register theme stylesheets.
    wp_register_style('thinkup-responsive', get_template_directory_uri() . '/styles/style-responsive.css', '', '1.1');
    wp_register_style('thinkup-sidebarleft', get_template_directory_uri() . '/styles/layouts/thinkup-left-sidebar.css', '', '1.1');
    wp_register_style('thinkup-sidebarright', get_template_directory_uri() . '/styles/layouts/thinkup-right-sidebar.css', '', '1.1');
    // Add theme stylesheets.
    wp_enqueue_style('thinkup-bootstrap', get_template_directory_uri() . '/lib/extentions/bootstrap/css/bootstrap.css', '', '2.3.2');
    wp_enqueue_style('thinkup-prettyPhoto', get_template_directory_uri() . '/lib/extentions/prettyPhoto/css/prettyPhoto.css', '', '3.1.6');
    wp_enqueue_style('thinkup-shortcodes', get_template_directory_uri() . '/styles/style-shortcodes.css', '', '1.1');
    wp_enqueue_style('thinkup-style', get_stylesheet_uri(), '', '1.0.7');
    // Add Font Packages.
    wp_enqueue_style('dashicons');
    wp_enqueue_style('thinkup-font-awesome', get_template_directory_uri() . '/lib/extentions/font-awesome/css/font-awesome.css', '', '4.2.0');
    // Add theme scripts
    wp_enqueue_script('thinkup-imagesloaded', get_template_directory_uri() . '/lib/scripts/plugins/imagesloaded/imagesloaded.js', array('jquery'), '1.3.4', true);
    wp_enqueue_script('thinkup-prettyPhoto', get_template_directory_uri() . '/lib/extentions/prettyPhoto/js/jquery.prettyPhoto.js', array('jquery'), '3.1.6', 'true');
    wp_enqueue_script('thinkup-frontend', get_template_directory_uri() . '/lib/scripts/main-frontend.js', array('jquery'), '1.1', 'true');
    wp_enqueue_script('thinkup-bootstrap', get_template_directory_uri() . '/lib/extentions/bootstrap/js/bootstrap.js', array('jquery'), '2.3.2', 'true');
    wp_enqueue_script('thinkup-modernizr', get_template_directory_uri() . '/lib/scripts/modernizr.js', array('jquery'), '2.6.2', 'true');
    // Register Retina script - Enqueued in 01.general-settings.php
    wp_register_script('thinkup-retina', get_template_directory_uri() . '/lib/scripts/retina.js', array('jquery'), '0.0.2', '', true);
    // Add Masonry scripts to Blog & Testimonials pag
    if (thinkup_check_isblog()) {
        wp_enqueue_script('thinkup-masonry', get_template_directory_uri() . '/lib/scripts/plugins/masonry/masonry.js', array('jquery'), '3.1.2', true);
    }
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    // Add ThinkUpSlider scripts
    if (is_front_page() or thinkup_check_ishome()) {
        wp_enqueue_script('thinkup-slider', get_template_directory_uri() . '/lib/scripts/plugins/ResponsiveSlides/responsiveslides.js', array('jquery'), '1.54', 'true');
        wp_enqueue_script('thinkup-slider-call', get_template_directory_uri() . '/lib/scripts/plugins/ResponsiveSlides/responsiveslides-call.js', array('jquery'), '', 'true');
    }
}
Example #4
0
function thinkup_input_blogpostexcerpt()
{
    global $thinkup_blog_postswitch;
    global $thinkup_blog_postexcerpt;
    global $thinkup_blog_pageid;
    $_thinkup_meta_blogpostexcerpts = get_post_meta($thinkup_blog_pageid, '_thinkup_meta_blogpostexcerpts', true);
    if ($thinkup_blog_postswitch == 'option1' or empty($thinkup_blog_postswitch)) {
        if (thinkup_check_isblog() or get_page_template_slug($thinkup_blog_pageid) == 'template-blog.php') {
            if (!is_numeric($_thinkup_meta_blogpostexcerpts)) {
                if (is_numeric($thinkup_blog_postexcerpt)) {
                    return $thinkup_blog_postexcerpt;
                }
            } else {
                if (is_numeric($_thinkup_meta_blogpostexcerpts)) {
                    return $_thinkup_meta_blogpostexcerpts;
                }
            }
        }
    }
    // return default value if not triggered above
    return 55;
}
function thinkup_input_sidebars()
{
    global $thinkup_general_sidebars;
    global $thinkup_homepage_sidebars;
    global $thinkup_blog_sidebars;
    global $thinkup_post_sidebars;
    global $thinkup_portfolio_sidebars;
    global $thinkup_project_sidebars;
    global $thinkup_woocommerce_sidebars;
    global $thinkup_woocommerce_sidebarsproduct;
    global $post;
    $_thinkup_meta_layout = get_post_meta($post->ID, '_thinkup_meta_layout', true);
    $_thinkup_meta_sidebars = get_post_meta($post->ID, '_thinkup_meta_sidebars', true);
    if (is_front_page()) {
        $output = $thinkup_homepage_sidebars;
    } else {
        if (is_page() and !is_page_template('template-blog.php')) {
            if (empty($_thinkup_meta_layout) or $_thinkup_meta_layout == 'option1' or $_thinkup_meta_sidebars == 'Select a sidebar:') {
                $output = $thinkup_general_sidebars;
            } else {
                $output = $_thinkup_meta_sidebars;
            }
        } else {
            if (is_page_template('template-blog.php')) {
                if (empty($_thinkup_meta_layout) or $_thinkup_meta_layout == 'option1' or $_thinkup_meta_sidebars == 'Select a sidebar:') {
                    $output = $thinkup_blog_sidebars;
                } else {
                    $output = $_thinkup_meta_sidebars;
                }
            } else {
                if (thinkup_check_isblog() and !is_single() and !is_post_type_archive('portfolio') and !is_post_type_archive('product')) {
                    $output = $thinkup_blog_sidebars;
                } else {
                    if (is_post_type_archive('portfolio')) {
                        $output = $thinkup_portfolio_sidebars;
                    } else {
                        if (is_post_type_archive('product') or is_tax('product_cat') or is_tax('product_tag')) {
                            $output = $thinkup_woocommerce_sidebars;
                        } else {
                            if (is_singular('post')) {
                                if (empty($_thinkup_meta_layout) or $_thinkup_meta_layout == 'option1' or $_thinkup_meta_sidebars == 'Select a sidebar:') {
                                    $output = $thinkup_post_sidebars;
                                } else {
                                    $output = $_thinkup_meta_sidebars;
                                }
                            } else {
                                if (is_singular('portfolio')) {
                                    if (empty($_thinkup_meta_layout) or $_thinkup_meta_layout == 'option1' or $_thinkup_meta_sidebars == 'Select a sidebar:') {
                                        $output = $thinkup_project_sidebars;
                                    } else {
                                        $output = $_thinkup_meta_sidebars;
                                    }
                                } else {
                                    if (is_singular('product')) {
                                        $output = $thinkup_woocommerce_sidebarsproduct;
                                    } else {
                                        if (is_search()) {
                                            $output = $thinkup_general_sidebars;
                                        } else {
                                            $output = $_thinkup_meta_sidebars;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    if (empty($output) or $output == 'Select a sidebar:') {
        $output = 'Sidebar';
    }
    return $output;
}
Example #6
0
function thinkup_frontscripts()
{
    // Add jQuery library.
    wp_enqueue_script('jquery-masonry');
    // Register theme stylesheets.
    wp_register_style('responsive', get_template_directory_uri() . '/styles/style-responsive.css', '', '1.1');
    wp_register_style('sidebarleft', get_template_directory_uri() . '/styles/layouts/thinkup-left-sidebar.css', '', '1.1');
    wp_register_style('sidebarright', get_template_directory_uri() . '/styles/layouts/thinkup-right-sidebar.css', '', '1.1');
    // Add theme stylesheets.
    wp_enqueue_style('bootstrap', get_template_directory_uri() . '/lib/extentions/bootstrap/css/bootstrap.min.css', '', '2.3.2');
    wp_enqueue_style('style', get_stylesheet_uri(), '', '1.7.6');
    wp_enqueue_style('shortcodes', get_template_directory_uri() . '/styles/style-shortcodes.css', '', '1.1');
    // Add Font Packages.
    wp_enqueue_style('font-awesome', get_template_directory_uri() . '/lib/extentions/font-awesome/css/font-awesome.min.css', '', '4.2.0');
    wp_enqueue_style('elusive-icons-css', get_template_directory_uri() . '/lib/extentions/elusive-icons/elusive-icons.css', '', '2.0');
    // Add theme scripts
    wp_enqueue_script('frontend', get_template_directory_uri() . '/lib/scripts/main-frontend.js', array('jquery'), '1.1', true);
    wp_enqueue_script('bootstrap', get_template_directory_uri() . '/lib/extentions/bootstrap/js/bootstrap.js', array('jquery'), '2.3.2', true);
    wp_enqueue_script('modernizr', get_template_directory_uri() . '/lib/scripts/modernizr.js', array('jquery'), '', true);
    // Register Retina script - Enqueued in 01.general-settings.php
    wp_register_script('retina', get_template_directory_uri() . '/lib/scripts/retina.js', array('jquery'), '0.0.2', '', true);
    // Add Blog scripts
    if (thinkup_check_isblog()) {
        wp_enqueue_script('jquery-masonry');
        wp_enqueue_script('imagesloaded', get_template_directory_uri() . '/lib/scripts/plugins/imagesloaded/imagesloaded.js', array('jquery'), '3.1.4', true);
    }
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    // Add ThinkUpSlider scripts
    if (is_front_page()) {
        wp_enqueue_script('thinkupslider', get_template_directory_uri() . '/lib/scripts/plugins/ResponsiveSlides/responsiveslides.min.js', array('jquery'), '1.54');
        wp_enqueue_script('thinkupslider-call', get_template_directory_uri() . '/lib/scripts/plugins/ResponsiveSlides/responsiveslides-call.js', array('jquery'));
    }
}
function thinkup_input_blogmediaclass($classes)
{
    global $post;
    $featured_id = get_post_thumbnail_id($post->ID);
    // Determine featured media to input
    if (thinkup_check_isblog()) {
        if (empty($featured_id)) {
            $classes[] = 'format-nomedia';
        }
    }
    return $classes;
}
function thinkup_title_select()
{
    global $post;
    if (is_page()) {
        printf(__('%s', 'lan-thinkupthemes'), get_the_title());
    } elseif (is_attachment()) {
        printf(__('Blog Post Image: %s', 'lan-thinkupthemes'), esc_attr(get_the_title($post->post_parent)));
    } else {
        if (is_single()) {
            printf(__('%s', 'lan-thinkupthemes'), get_the_title());
        } else {
            if (is_search()) {
                printf(__('Search Results: %s', 'lan-thinkupthemes'), get_search_query());
            } else {
                if (is_404()) {
                    printf(__('Page Not Found', 'lan-thinkupthemes'));
                } else {
                    if (is_category()) {
                        printf(__('Category Archives: %s', 'lan-thinkupthemes'), single_cat_title('', false));
                    } elseif (is_tag()) {
                        printf(__('Tag Archives: %s', 'lan-thinkupthemes'), single_tag_title('', false));
                    } elseif (is_author()) {
                        the_post();
                        printf(__('Author Archives: %s', 'lan-thinkupthemes'), get_the_author());
                        rewind_posts();
                    } elseif (is_day()) {
                        printf(__('Daily Archives: %s', 'lan-thinkupthemes'), get_the_date());
                    } elseif (is_month()) {
                        printf(__('Monthly Archives: %s', 'lan-thinkupthemes'), get_the_date('F Y'));
                    } elseif (is_year()) {
                        printf(__('Yearly Archives: %s', 'lan-thinkupthemes'), get_the_date('Y'));
                    } elseif (is_post_type_archive('portfolio')) {
                        printf(__('Portfolio', 'lan-thinkupthemes'));
                    } elseif (thinkup_check_isblog()) {
                        printf(__('Blog', 'lan-thinkupthemes'));
                    } else {
                        printf(__('%s', 'lan-thinkupthemes'), get_the_title());
                    }
                }
            }
        }
    }
}