function ac_portfolio_has_images($post = 0) { // Get the post $post = get_post($post); $images = ac_get_images_for_post($post->ID, ac_get_meta('include_featured_image', null, $post->ID)); return count($images) > 0; }
function ac_render_ac_easy_slideshow($full_width = false, $type = 'royalslider') { // We need to build an array of posts to pass through to the RoyalSlider function $posts = array(); // Should we include the featured image? if (has_post_thumbnail() && ac_get_meta('include_featured_image') == 1) { $posts[] = get_post(get_post_thumbnail_id()); } // Get the images to use $images = ac_get_meta('images', array('type' => 'image_advanced')); // Add them to the slides foreach ($images as $image) { // Add to our slides $posts[] = get_post($image['ID']); } $args = array('slider_style' => 'no-caption', 'slider_size' => 'square', 'class' => 'ac_easy_slider'); if ($full_width) { $args['full_width'] = true; } // Render the slideshow if (count($posts)) { if ($type == 'royalslider') { echo ac_render_posts_slideshow($args, $posts); } else { echo ac_render_slick_carousel($args, $posts); } return true; } return false; }
function ac_body_data() { // Is there a one page menu defined? $page_menu = ac_get_meta("page_menu"); if ($page_menu) { echo ' data-spy="scroll" data-target=".nav-main" '; } }
function ac_person_get_position($post = 0) { $post = get_post($post); // Get the position $position = ac_get_meta('position'); // If we have a position wrap it if ($position) { $position = '<h3 class="position">' . $position . '</h3>'; } return $position; }
function ac_testimonial_render($testimonial_id, $show_image = true, $excerpt_length = -1) { // Get the post $post = get_post($testimonial_id); // Show the image? Tiles don't show the image inline if ($show_image) { // Get the thumbnail id $thumb_id = get_post_thumbnail_id($testimonial_id); } else { $thumb_id = false; } // Get the excerpt $excerpt = ac_get_excerpt($post, $excerpt_length, false, false); // Author $author = ac_get_meta('author', null, $testimonial_id); $author_url = ac_get_meta('author_url', null, $testimonial_id); return ac_quote_render($thumb_id, $excerpt, $author, $author_url); }
function ac_page_title_header_style($post = 0) { global $ac_full_width_pixels; $post = get_post($post); // Only return style for custom header $page_title_type = ac_get_meta('page_title_type'); if ($page_title_type == 'custom') { $bg_color = ac_get_meta('page_title_bg_color'); if ($bg_color) { $bg_color = 'background-color: ' . $bg_color . '; '; } $bg_img = ac_get_meta('page_title_image', array('type' => 'image_advanced')); $bg_img_style = ''; if ($bg_img) { $bg_img = $bg_img[key($bg_img)]; // Resize to max allowed for site $img_args = array('image_id' => $bg_img['ID'], 'width' => ac_get_full_width_px(), 'height' => 600); $image = ac_resize_image($img_args); $bg_img_style = 'background-image: url(' . $image['url'] . '); '; } return $bg_color . $bg_img_style; } return ''; }
function ac_social_sharing($post_type = '') { // Render if the page option is true if (is_singular($post_type) && ac_get_meta('page_show_share_buttons')) { shoestrap_social_sharing(); } }
<section class='side-meta col-xs-12 col-sm-<?php echo $aside_cols; ?> ac-page-right-side'> <?php echo ac_render_image_for_columns(array('image_id' => get_post_thumbnail_id(), 'columns' => $aside_cols)); ?> <?php get_template_part('templates/page-side-meta', 'person'); ?> </section> <div class='col-sm-8 ac-page-left-side'> <?php $position = ac_get_meta('position'); if ($position) { ?> <h2 class="position"><?php echo $position; ?> </h2> <?php } the_content(); ?> </div> <div class="clearfix"></div> <?php do_action('shoestrap_single_after_content'); ?>
echo esc_html($page_custom_subtitle); ?> </p> <?php } ?> <?php the_content(); ?> </div> <?php } else { // Images $images = ac_get_images_for_post(get_the_ID(), ac_get_meta('include_featured_image')); if (count($images)) { ?> <div class='post-images'> <?php foreach ($images as $image_id) { $a_start = ''; $a_end = ''; if ($lightbox_images) { $img = ac_resize_image_for_columns(array('image_id' => $image_id, 'columns' => 12, 'ratio' => AC_IMAGE_RATIO_PRESERVE)); $a_start = '<a class="prettyphoto" href="' . esc_url($img['url']) . '" rel="prettyPhoto[rel-' . ac_get_prettyphoto_rel() . ']"><div>'; $a_end = '</div></a>'; } echo $a_start; echo ac_render_image_for_columns(array('image_id' => $image_id, 'columns' => 7, 'ratio' => AC_IMAGE_RATIO_PRESERVE)); echo $a_end; }
function shoestrap_container_class($region = '') { // AC Modified //$region can be header, main, footer, ac-page-hero-img $site_style = shoestrap_getVariable('site_style'); // Check for specific scenarios // Page is set to full width (affects main only) if ($region == 'main' && is_singular() && ac_get_meta('page_full_width') == 1) { return 'fluid'; } // Gallery Main is fluid, but header and footer remain container if ($region == 'main' && is_singular('ac_gallery') && $site_style == 'wide') { return 'fluid'; } // Footer Copyright is always container if ($region == 'footer-copyright') { return 'container'; } // Footer Content if ($region == 'footer-content') { switch ($site_style) { case 'wide': return 'container'; default: return ''; } } // When boxed some sections dont get container class if ($site_style == 'boxed') { switch ($region) { case 'header': return ''; } } elseif ($site_style == 'wide') { switch ($region) { case 'ac-page-hero-img': return ''; } } return 'container'; }
// No author, no link $a_start = ''; $a_end = ''; } // No title for testiomonials, as the excerpt is the testimonial $show_title = false; // Never show the excerpt for testimonials, the content comes from the testimonial method $show_excerpt = false; // No terms for Testimonial $show_terms = false; } else { if (get_post_type($post) == 'ac_portfolio') { // Different image ratios for tile-masonry if ($layout == 'tile-masonry') { // Portfolio item may have different tile image size $tile_masonry_size = ac_get_meta('tile_masonry_size'); // Use the col_class to set the tile shape $cols_class = $tile_masonry_size; if (!$cols_class) { $cols_class = 'standard'; } $cols_class = 'ac-tm-' . $cols_class . '-' . $column_count; // Default image dimensions to square $img_height_style = AC_IMAGE_RATIO_SQUARE; // Square switch ($tile_masonry_size) { case 'large': $img_cols = $img_cols * 2; break; case 'landscape': $img_cols = $img_cols * 2;
<form action="<?php echo home_url(); ?> " method="GET"> <input type="text" name="s" value="" placeholder="<?php _e('Search', 'alleycat'); ?> <?php bloginfo('name'); ?> " /> <button type="submit" id="searchsubmitnav" class="ac-transparent-btn searchsubmit"><i class="entypo-icon-search"></i></button> </form> </li> <?php // Does this page have a defined menu? $page_menu = ac_get_meta("page_menu"); // Render the menu wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => shoestrap_nav_class_pull(), 'container' => '', 'items_wrap' => '%3$s', 'depth' => 10, 'menu' => $page_menu)); } else { // Inform user echo '<li><a href="">Assign a menu</a></li>'; } ?> </ul><?php } do_action('shoestrap_inside_nav_end'); ?> </nav> <?php do_action('shoestrap_post_main_nav');
<?php // Terms $terms = get_the_term_list($post->ID, 'portfolio-category', '', ', ', ''); if ($terms) { ?> <li><span>Type: </span> <?php echo $terms; ?> </li><?php } ?> <?php // Check for external URL $url = ac_get_meta('url'); if ($url) { ?> <li class='portolio-link' ><span>Link: </span><a id="portfolio-link" href='<?php echo esc_url($url); ?> ' target='_blank'>View Project</a></li> <?php } ?> </ul> <?php } // Show meta // Do we show the sidebar widgets? if ($show_portfolio_sidebar == 'sidebar' || $show_portfolio_sidebar == 'both') {
function ac_navbar_start_transparent() { /* Activates when 1. Page has Alleycat Slider, but no title, or custom title 2. or Page has Rev slider, but no title, or custom title 3. or Custom title Post level switch on - Post - Page - Portfolio - Galleries Disable on post level Force on post level */ // Can only apply to singular if (!is_singular()) { return false; } // If we have a page setting respect that, irrespective of theme setting $page_setting = ac_get_meta('page_transparent_header'); if ($page_setting == 'disable') { return false; } if ($page_setting == 'force') { return true; } // If the feature is off do nothing $theme_on = shoestrap_getVariable('navbar_transparent'); if (!$theme_on) { return false; } // Get values $return = false; $title = ac_get_meta('page_title_type'); $slider = ac_get_meta('slideshow_type'); $post_type = get_post_type(); // Automatic detection $ac_slider_set = $slider == 'ac'; $rev_slider_set = $slider == 'revslider'; $custom_title_set = $title == 'custom'; $is_post = $post_type == 'post' && (has_post_thumbnail() || $ac_slider_set || $rev_slider_set); $is_page = $post_type == 'page' && (has_post_thumbnail() || $ac_slider_set || $rev_slider_set) && $title == 'none'; // Portfolio // Has Template:Images At Top setting $top_images = in_array(ac_get_meta("template_type"), array('top-images', 'top-images-carousel')); $has_images = ac_portfolio_has_images(); $is_portfolio = $post_type == 'ac_portfolio' && ($top_images && $has_images); // Title's currently disabled for Portfolio $ac_slider_ok = $ac_slider_set && $title == 'none'; $rev_slider_ok = $rev_slider_set && $title == 'none'; // Auto detect $return = $ac_slider_ok || $rev_slider_ok || $custom_title_set || $is_post || $is_page || $is_portfolio; return $return; }
echo $phone_number; ?> </span></li> <?php } $email_address = ac_get_meta('email_address'); if ($email_address) { ?> <li class="email-address"><i class="entypo smaller icon-link-1"></i><a href="mailto:<?php echo $email_address; ?> "><?php echo $email_address; ?> </a></li> <?php } $web_address = ac_get_meta('web_address'); if ($web_address) { ?> <li class="web-address"><i class="entypo smaller icon-mail-1"></i><a href="<?php echo esc_url(ac_ensure_http($web_address)); ?> "><?php echo $web_address; ?> </a></li> <?php } ?> <?php echo ac_person_get_all_social_icons($post, 'li'); ?>
function ac_render_author_bio($post = 0) { global $post_types_with_author_bio; // The post $post = get_post($post); // Render the bio if forced on the post level, or fallback to the theme options // Get the post type $post_type = get_post_type($post); // Does this post type have Bio? if (in_array($post_type, $post_types_with_author_bio)) { // Check at post level $post_show = ac_get_meta('author_bio_show'); // Never continue if no show at post level if ($post_show == 'false') { return; } // Show at Theme Options level $theme_show = shoestrap_getVariable('author_bio_show'); if ($theme_show) { // global setting switch ($post_type) { // post type settings case 'post': $theme_show = filter_var(shoestrap_getVariable('author_bio_show_post'), FILTER_VALIDATE_BOOLEAN); break; case 'page': $theme_show = filter_var(shoestrap_getVariable('author_bio_show_page'), FILTER_VALIDATE_BOOLEAN); break; } } if ($post_show || $theme_show) { // Get the bio $bio = get_the_author_meta('description', $post->post_author); $author = get_the_author_meta('display_name', $post->post_author); $authorurl = get_author_posts_url(get_the_author_meta("ID")); // Avatar $avatar = get_avatar($post->post_author, 256, '', get_the_author_meta('user_nicename', $post->post_author)); $bio_class = ''; $col1_class = ' '; $col2_class = ' col-md-12 '; if ($avatar) { $bio_class = ' has-avatar '; $col1_class = ' col-lg-2 col-md-2 col-sm-12 col-xs-12 '; $col2_class = ' col-lg-10 col-md-10 col-sm-12 col-xs-12 '; } if ($bio) { ?> <div class='ac-author-bio <?php echo $bio_class; ?> '> <div class='row'> <div class='<?php echo $col1_class; ?> '><?php echo $avatar; ?> </div> <div class='<?php echo $col2_class; ?> '> <h4><a class="author" href="<?php echo esc_url($authorurl); ?> "><?php echo $author; ?> </a></h4> <?php echo ac_format_post_content($bio); ?> </div> </div> </div> <?php } } } }
<div class='ac-page-hero-img ac-no-container-padding <?php echo esc_attr($hero_class); ?> '><?php ac_render_ac_easy_slideshow(true); ?> </div><?php $show_featured_image = false; } else { if ($template_type == 'top-images-carousel') { ?> <div class='ac-page-hero-img ac-no-container-padding <?php echo esc_attr($hero_class); ?> '><?php $images = ac_get_images_for_post(ac_get_post_id(), ac_get_meta('include_featured_image', null, ac_get_post_id())); ac_render_slick_carousel_from_images($images); ?> </div><?php $show_featured_image = false; } } break; case 'ac_testimonial': $show_featured_image = false; break; case 'product': // WooCommerce $show_featured_image = false; break; }
function ac_get_images_for_post($post = 0, $include_featured_image = true) { // Get the post $post = get_post($post); $return = array(); // Should we include the featured image? if ($include_featured_image == true) { $feat_img = get_post_thumbnail_id(); if ($feat_img) { // Add to our slides $return[] = get_post_thumbnail_id(); } } // Get the images to use $images = ac_get_meta('images', array('type' => 'image_advanced')); if ($images) { // Add them to the slides foreach ($images as $image) { // Add to our slides $return[] = $image['ID']; } } return $return; }