function shoestrap_featured_image($full_width = false, $link = true, $square = false, $width = false, $height = false) { add_theme_support('post-thumbnails'); if (!has_post_thumbnail() || '' == get_the_post_thumbnail()) { // Get the URL of the blank image return; } // Get the width if ($full_width) { $data['width'] = ac_get_full_width_px(); } else { $data['width'] = shoestrap_content_width_px(); } $data['height'] = shoestrap_getVariable('ac_feat_img_height'); // AC - new setting if (is_single() || is_page()) { if (shoestrap_getVariable('feat_img_post') != 1) { return; } // Do not process if we don't want images on single posts $data['url'] = wp_get_attachment_url(get_post_thumbnail_id()); if (shoestrap_getVariable('feat_img_post_custom_toggle') == 1) { $data['width'] = shoestrap_getVariable('feat_img_post_width'); $data['height'] = shoestrap_getVariable('feat_img_post_height'); } } else { if (shoestrap_getVariable('feat_img_archive') == 0) { return; } // Do not process if we don't want images on post archives $data['url'] = wp_get_attachment_url(get_post_thumbnail_id()); if (shoestrap_getVariable('feat_img_archive_custom_toggle') == 1) { $data['width'] = shoestrap_getVariable('feat_img_archive_width'); $data['height'] = shoestrap_getVariable('feat_img_archive_height'); } } // Check for square image if ($square) { $data['height'] = $data['width']; } // Check for width and height overrides if ($height) { $data['height'] = $height; } if ($width) { $data['width'] = $width; } //AC - alt $alt = "alt='" . ac_get_image_alt(get_post_thumbnail_id()) . "'"; $image = shoestrap_image_resize($data); $output = '<img class="featured-image" src="' . $image['url'] . '" ' . $alt . ' />'; if ($link) { $output = '<a href="' . get_permalink() . '">' . $output . '</a>'; } echo $output; }
require_once AC_LIB_PATH . '/nav.php'; // Custom nav modifications require_once AC_LIB_PATH . '/gallery.php'; // Custom [gallery] modifications require_once AC_LIB_PATH . '/comments.php'; // Custom comments modifications require_once AC_LIB_PATH . '/widgets.php'; // Sidebars and widgets require_once AC_LIB_PATH . '/scripts.php'; // Scripts and stylesheets require_once AC_LIB_PATH . '/modules/core.menus/functions.navwalker.php'; // AC - Register Custom Navigation Walker /* IMAGE SIZES ------------------------------------------------------------------- */ // Dynamic. As the width of the site can change we need to calculate the image sizes dynamically $three_col = shoestrap_content_width_px() / 4; add_image_size('three-col', $three_col, $three_col, true); /* AC VC PLUGINS ------------------------------------------------------------------- */ // Only load the Visual Composer elements if the plugin has been installed if (ac_visual_composer_is_installed()) { add_action('vc_before_init', 'ac_vc_before_init'); // Init VC require_once AC_FRAMEWORK_PATH . '/vc-plugins/ac-row.php'; require_once AC_FRAMEWORK_PATH . '/vc-plugins/ac-vc-base.php'; require_once AC_FRAMEWORK_PATH . '/vc-plugins/ac-image.php'; require_once AC_FRAMEWORK_PATH . '/vc-plugins/ac-text-block.php'; require_once AC_FRAMEWORK_PATH . '/vc-plugins/ac-block-quote.php'; require_once AC_FRAMEWORK_PATH . '/vc-plugins/ac-featured-post.php'; require_once AC_FRAMEWORK_PATH . '/vc-plugins/ac-posts-builder-base.php'; require_once AC_FRAMEWORK_PATH . '/vc-plugins/ac-posts.php';
function shoestrap_content_width() { global $content_width; $content_width = shoestrap_content_width_px(); }