File manager - Edit - /home/carfac/public_html/REPhotoUtah/wp-content/themes/outdoor/functions.php
Back
<?php if ( file_exists(get_template_directory() . '/functions/admin-config.php') ) { require_once (get_template_directory() . '/functions/admin-config.php'); } if(!isset($outdoor_options)) $outdoor_options = get_option( 'outdoor_options', array() ); if (!function_exists('outdoor_setup_theme')) { /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. * * @since Outdoor 1.0 */ function outdoor_setup_theme() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. */ load_theme_textdomain( 'outdoor', get_template_directory() . '/languages' ); // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded <title> tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); add_theme_support('post-thumbnails'); outdoor_get_thumbnail_sizes(); // Set the default content width. $GLOBALS['content_width'] = apply_filters( 'outdoor_content_width', 862.5 ); // to output valid HTML5. add_theme_support('html5', array('search-form', 'comment-form', 'comment-list')); //Post formats add_theme_support('post-formats', array('audio', 'gallery', 'image', 'link', 'quote', 'status', 'video')); add_theme_support('custom-header'); add_theme_support('custom-background'); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); // from version 2.0 add_theme_support( 'woocommerce' ); // add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); // This theme uses wp_nav_menu() in one location. register_nav_menu('primary', esc_html__('Primary Menu (Main Navigation)', 'outdoor')); // This theme uses its own gallery styles. $dynamic_menus = outdoor_get_option('dynamic_menus', array()); if ( !empty($dynamic_menus)) { foreach ((array)$dynamic_menus as $key => $location) { register_nav_menu(sanitize_title($location), $location); } } add_filter('use_default_gallery_style', '__return_false'); add_editor_style(get_template_directory_uri().'/inc/assets/custom-editor-style.css'); } } add_action('after_setup_theme', 'outdoor_setup_theme'); if(!function_exists('outdoor_get_thumbnail_sizes')){ function outdoor_get_thumbnail_sizes(){ // options default must have these values if( false == outdoor_get_option('enable_custom_sizes') ) return; $option_sizes = array( 'outdoorfuls-thumb'=>'fullscreen_thumb', 'outdoorhoz-thumb'=>'horizontal_slider_thumb', 'outdoorhozver-thumb'=>'folio_hozver_thumb', 'outdoormulti-thumb'=>'multislider_thumb', 'outdoorgal-grid'=>'galgrid_thumbnail_size', 'outdoorfolio-grid'=>'fogrid_thumbnail_size_one', 'outdoormasonry-size-one'=>'galmasonry_thumbnail_size_one', 'outdoormasonry-size-two'=>'galmasonry_thumbnail_size_two', 'outdoormember-thumb'=>'team_member_thumb', 'outdoor-service-thumb'=>'service_bg_thumb', 'outdoorblog-thumb'=>'blog_image_thumb', ); foreach ($option_sizes as $name => $opt) { $option_size = outdoor_get_option($opt); if($option_size !== false && is_array($option_size)){ $size_val = array( 'width' => (isset($option_size['width']) && !empty($option_size['width']) )? (int)$option_size['width'] : (int)'9999', 'height' => (isset($option_size['height']) && !empty($option_size['height']) )? (int)$option_size['height'] : (int)'9999', 'hard_crop' => (isset($option_size['hard_crop']) && !empty($option_size['hard_crop']) )? (bool)$option_size['hard_crop'] : (bool)'0', ); add_image_size( $name, $size_val['width'], $size_val['height'], $size_val['hard_crop'] ); } } add_image_size('outdoor-carousel', esc_html_x('823', 'carousel slider width','outdoor' ), esc_html_x('549', 'carousel slider height', 'outdoor' ), true ); //add_image_size('shop_catalog', esc_html__('375','outdoor' ), esc_html__('375','outdoor' ), true ); } } /** * Set the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function outdoor_content_width() { $content_width = $GLOBALS['content_width']; // Check if is single post and there is no sidebar. if ( is_single() && ! is_active_sidebar( 'sidebar-1' ) ) { $content_width = 1040; } /** * Filter outdoor content width of the theme. * * * @param int $content_width Content width in pixels. */ $GLOBALS['content_width'] = apply_filters( 'outdoor_content_width_templ', $content_width ); } add_action( 'template_redirect', 'outdoor_content_width', 0 ); /** * Register widget area. * * @since Outdoor 1.0 * * @link https://codex.wordpress.org/Function_Reference/register_sidebar */ function outdoor_register_sidebars() { register_sidebar( array( 'name' => esc_html__('Main Sidebar', 'outdoor'), 'id' => 'sidebar-1', 'description' => esc_html__('Appears in the sidebar section of the site.', 'outdoor'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3><div class="clearfix"></div>', ) ); register_sidebar( array( 'name' => esc_html__('Page Sidebar', 'outdoor'), 'id' => 'sidebar-2', 'description' => esc_html__('Appears in the sidebar section of the page template.', 'outdoor'), 'before_widget' => '<div id="%1$s" class="widget cth %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3><div class="clearfix"></div>', ) ); register_sidebar( array( 'name' => esc_html__('Shop Page Sidebar', 'outdoor'), 'id' => 'sidebar-shop', 'description' => esc_html__('Appears in the sidebar section on shop pages.', 'outdoor'), 'before_widget' => '<div id="%1$s" class="widget cth-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3><div class="clearfix"></div>', ) ); register_sidebar( array( 'name' => esc_html__('Social Share', 'outdoor'), 'id' => 'social_share_widget', 'description' => esc_html__('Widget area for Share menu. To use this area you must leave Share Names field on Outdoor Options > Social Share Settings empty', 'outdoor'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => esc_html__('Footer Columns Widget', 'outdoor'), 'id' => 'footer_columns_widget', 'description' => esc_html__('Appears above the footer copyright content.', 'outdoor'), 'before_widget' => '<div id="%1$s" class="footer-widget %2$s ' . outdoor_slbd_count_widgets('footer_columns_widget') . '">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); } add_action('widgets_init', 'outdoor_register_sidebars'); if(!function_exists('outdoor_slbd_count_widgets')){ /** * Count number of widgets in a sidebar * Used to add classes to widget areas so widgets can be displayed one, two, three or four per row */ function outdoor_slbd_count_widgets($sidebar_id) { // If loading from front page, consult $_wp_sidebars_widgets rather than options // to see if wp_convert_widget_settings() has made manipulations in memory. global $_wp_sidebars_widgets; if (empty($_wp_sidebars_widgets)): $_wp_sidebars_widgets = get_option('sidebars_widgets', array()); endif; $sidebars_widgets_count = $_wp_sidebars_widgets; if (isset($sidebars_widgets_count[$sidebar_id])): $widget_count = count($sidebars_widgets_count[$sidebar_id]); $widget_classes = 'widget-count-' . count($sidebars_widgets_count[$sidebar_id]); if ($widget_count % 6 == 0 && $widget_count >= 6): // Six widgets er row if there are exactly four or more than six $widget_classes.= ' col-md-2'; elseif ($widget_count % 4 == 0 && $widget_count >= 4): // Four widgets er row if there are exactly four or more than six $widget_classes.= ' col-md-3'; elseif ($widget_count % 3 == 0 && $widget_count >= 3): // Three widgets per row if there's three or more widgets $widget_classes.= ' col-md-4'; elseif (2 == $widget_count): // Otherwise show two widgets per row $widget_classes.= ' col-md-6'; elseif (1 == $widget_count): // Otherwise show two widgets per row $widget_classes.= ' col-md-12'; endif; return $widget_classes; endif; } } /** * Enqueue scripts and styles. * * @since Outdoor 1.0 */ if (!function_exists('outdoor_scripts_styles')) { function outdoor_scripts_styles() { if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } wp_enqueue_script("outdoorplugins-js", get_template_directory_uri() . "/js/plugins.js", array('jquery'), null, true); wp_enqueue_script("outdoorscripts-js", get_template_directory_uri() . "/js/scripts.js", array(), null, true); wp_localize_script( 'outdoorscripts-js', '_outdoor', array( 'image_popup_type' => outdoor_global_var('image_popup_type'), ) ); //wp_enqueue_style('outdoorreset', get_template_directory_uri() . '/css/reset.css', array(), null); wp_enqueue_style('outdoorplugins', get_template_directory_uri() . '/css/plugins.css', array(), null); if(outdoor_is_woocommerce_activated()){ wp_enqueue_style('outdoorwoo-style', get_template_directory_uri() . '/css/woocommerce.css', array(), null); } wp_enqueue_style('outdoortheme-style', get_stylesheet_uri(), array(), null); if(outdoor_is_woocommerce_activated()){ wp_enqueue_style('outdoorshop-style', get_template_directory_uri() . '/css/shop.css', array(), null); } wp_enqueue_style('outdoorcustom-style', get_template_directory_uri() . '/css/custom.css', array(), null); if ( outdoor_get_option('override-preset') ) { $inline_style = outdoor_overridestyle(); if (!empty($inline_style)) { wp_add_inline_style('outdoorcustom-style', $inline_style); } } $inline_custom_style = trim( outdoor_get_option('custom-css') ); $medium_css = trim( outdoor_get_option('custom-css-medium') ); if( !empty( $medium_css ) ){ $inline_custom_style .= '@media only screen and (max-width: 1200px){'.$medium_css.'}'; } $tablet_css = trim( outdoor_get_option('custom-css-tablet') ); if( !empty( $tablet_css ) ){ $inline_custom_style .= '@media only screen and (max-width: 756px){'.$tablet_css.'}'; } $mobile_css = trim( outdoor_get_option('custom-css-mobile') ); if( !empty( $mobile_css ) ){ $inline_custom_style .= '@media only screen and (max-width: 540px){'.$mobile_css.'}'; } if (!empty($inline_custom_style)) { wp_add_inline_style('outdoorcustom-style', outdoor_stripWhitespace($inline_custom_style) ); } } } add_action('wp_enqueue_scripts', 'outdoor_scripts_styles'); /** * Enqueue admin scripts and styles. * * @since Outdoor 1.0 */ if (!function_exists('outdoor_enqueue_admin_scripts')) { function outdoor_enqueue_admin_scripts() { wp_enqueue_script('outdoor-admin', get_template_directory_uri() .'/inc/assets/theme_admin_script.js', array('jquery')); wp_enqueue_style('outdooradmin-styles', get_template_directory_uri() . '/inc/assets/admin_styles.css'); } } add_action('admin_enqueue_scripts', 'outdoor_enqueue_admin_scripts'); /* Enable shortcode in widget text content */ add_filter('widget_text', 'do_shortcode'); /** * Modify menu link class attribute * * @since Outdoor 1.0 */ add_filter('nav_menu_css_class', 'outdoor_nav_menu_css_class_func', 10, 2); $outdoor_menu_link_class = array(); function outdoor_nav_menu_css_class_func($classes, $item) { global $outdoor_menu_link_class; $outdoor_menu_link_class = array(); $current_menu = array_search("current-menu-item", $classes); if ($current_menu !== false) { $outdoor_menu_link_class[] = 'act-link'; } $current_menu_ancestor = array_search("current-menu-ancestor", $classes); if ($current_menu_ancestor !== false) { $outdoor_menu_link_class[] = 'ancestor-act-link'; } $current_menu_parent = array_search("current-menu-parent", $classes); if ($current_menu_parent !== false) { $outdoor_menu_link_class[] = 'parent-act-link'; } return $classes; } add_filter('nav_menu_link_attributes', 'outdoor_nav_menu_link_attributes_func', 10, 3); function outdoor_nav_menu_link_attributes_func($atts, $item, $args) { global $outdoor_menu_link_class; if (!empty($outdoor_menu_link_class)) { $atts['class'] = implode(" ", $outdoor_menu_link_class); } return $atts; } /** * Change posts per page setting for portfolio archive pages. * * @since Outdoor 1.0 */ function outdoor_pagesize($query) { if (is_admin() || !$query->is_main_query()) return; if (is_post_type_archive('portfolio') || is_tax('portfolio_cat')) { // Display 50 posts for a custom post type called 'portfolio' if ( outdoor_get_option('folio_posts_per_page') ) { $query->set('posts_per_page', outdoor_get_option('folio_posts_per_page')); } // oder portfolio posts if ( outdoor_get_option('folio_archive_orderby') ) { $query->set('orderby', outdoor_get_option('folio_archive_orderby')); } if ( outdoor_get_option('folio_archive_order') ) { $query->set('order', outdoor_get_option('folio_archive_order')); } return; } if (is_post_type_archive('product') || is_tax('product_cat') || is_tax('product_tag')) { // Display 50 posts for a custom post type called 'portfolio' if ( outdoor_get_option('shop_posts_per_page') ) { $query->set('posts_per_page', outdoor_get_option('shop_posts_per_page')); } return; } } add_action('pre_get_posts', 'outdoor_pagesize', 1); /** * Left page fixed title * * @since Outdoor 1.0 */ if (!function_exists('outdoor_fixed_title')) { function outdoor_fixed_title() { // Get the query & post information global $post, $wp_query; if (!is_home()) { if (is_archive() && !is_tax()) { if (is_post_type_archive('portfolio')) { esc_html_e('Our Portfolio', 'outdoor'); } else { if( outdoor_is_woocommerce_activated() ){ if(is_shop()) echo get_the_title( wc_get_page_id( 'shop' ) ); }else{ echo get_the_archive_title(); } } } else if (is_archive() && is_tax()) { // If post is a custom post type $post_type = get_post_type(); // If it is a custom post type display name and link if ($post_type == 'portfolio') { $term = $wp_query->get_queried_object(); echo esc_attr($term->name); } elseif ($post_type != 'post') { $post_type_object = get_post_type_object($post_type); echo esc_attr($post_type_object->labels->name); } } else if (is_single()) { echo get_the_title(); } else if (is_category()) { } else if (is_page()) { echo get_the_title(); } else if (is_search()) { echo esc_html__('Search Blog', 'outdoor'); } elseif (is_404()) { echo esc_html__('Page not found', 'outdoor'); } } else { echo esc_attr( outdoor_get_option('blog_home_text') ); } } } /** * Theme pagination * * @since Outdoor 1.0 */ if (!function_exists('outdoor_pagination')) { function outdoor_pagination($prev = 'Prev', $next = 'Next', $pages = '', $sec_wrap = false) { global $wp_query, $wp_rewrite; $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; if ($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if (!$pages) { $pages = 1; } } $pagination = array('base' => str_replace(999999999, '%#%', get_pagenum_link(999999999)), 'format' => '', 'current' => max(1, get_query_var('paged')), 'total' => $pages, 'prev_text' => $prev, 'next_text' => $next, 'type' => 'plain', 'end_size' => 3, 'mid_size' => 3); $return = paginate_links($pagination); $return = str_replace(array('page-numbers', 'next', 'prev', 'current'), array('blog-page transition', 'nextposts-link', 'prevposts-link', 'current-page'), $return); if (!empty($return)) { if ($sec_wrap) echo '<section class="custom_folio_pagi">'; echo '<div class="clearfix"></div><div class="pagination-blog">' . $return . '</div>'; if ($sec_wrap) echo '</section>'; } } } /** * Pagination for Portfolio page templates * * @since Outdoor 1.0 */ if (!function_exists('outdoor_custom_pagination')) { function outdoor_custom_pagination($pages = '', $range = 2, $current_query = '', $sec_wrap = false) { $showitems = ($range * 2) + 1; if ($current_query == '') { global $paged; if (empty($paged)) $paged = 1; } else { $paged = $current_query->query_vars['paged']; } if ($pages == '') { if ($current_query == '') { global $wp_query; $pages = $wp_query->max_num_pages; if (!$pages) { $pages = 1; } } else { $pages = $current_query->max_num_pages; } } if (1 != $pages) { echo '<div class="clearfix"></div>'; if ($sec_wrap) echo '<section class="no-padding">'; echo '<div class="container custom-pagi"><div class="pagination-blog">'; if ($paged > 1) echo '<a href="' . get_pagenum_link($paged - 1) . '" class="prevposts-link transition">' . wp_kses(__('<i class="fa fa-chevron-left"></i>', 'outdoor'), array('i' => array('class' => array()))) . '</a>'; for ($i = 1; $i <= $pages; $i++) { if (1 != $pages && (!($i >= $paged + $range + 1 || $i <= $paged - $range - 1) || $pages <= $showitems)) { if( $paged == $i ) echo "<span class='current-page'>" . $i . "</span>"; else echo "<a href='" . get_pagenum_link($i) . "' class='blog-page transition' >" . $i . "</a>"; } } if ($paged < $pages) echo '<a href="' . get_pagenum_link($paged + 1) . '" class="nextposts-link transition">' . wp_kses(__('<i class="fa fa-chevron-right"></i>', 'outdoor'), array('i' => array('class' => array()))) . '</a>'; echo "</div></div>\n"; if ($sec_wrap) echo "</section>\n"; } } } /** * Blog post nav * * @since Outdoor 1.0 */ if (!function_exists('outdoor_post_nav')) { function outdoor_post_nav() { global $post; // Don't print empty markup if there's nowhere to navigate. $previous = (is_attachment()) ? get_post($post->post_parent) : get_adjacent_post(false, '', true); $next = get_adjacent_post(false, '', false); if (!$next && !$previous) return; ?> <div class="content-nav blg-nav"> <ul> <li><?php previous_post_link('%link', wp_kses(_x('<i class="fa fa-long-arrow-left"></i>', 'Previous post link', 'outdoor'), array('i' => array('class' => array())))); ?></li> <?php echo wp_kses(__('<li><span>/</span></li>', 'outdoor'), array('li' => array('class' => array()), 'span' => array('class' => array()))); ?> <li><?php next_post_link('%link', wp_kses(_x('<i class="fa fa-long-arrow-right"></i>', 'Next post link', 'outdoor'), array('i' => array('class' => array())))); ?></li> </ul> <?php if ( $all_link = outdoor_get_option('blog_list_link') ): ?> <div class="p-all"> <a href="<?php echo esc_url($all_link); ?>" ><i class="fa fa-th-large"></i></a> </div> <?php endif; ?> </div> <?php } } /** * Change next post link class attribute * * @since Outdoor 1.0 */ add_filter('next_post_link', 'outdoor_add_css_class_to_next_post_link'); function outdoor_add_css_class_to_next_post_link($link) { $link = str_replace("<a ", "<a class='ajax left-nav' ", $link); return $link; } /** * Change next post link class attribute * * @since Outdoor 1.0 */ add_filter('previous_post_link', 'outdoor_add_css_class_to_previous_post_link'); function outdoor_add_css_class_to_previous_post_link($link) { $link = str_replace("<a ", "<a class='ajax right-nav' ", $link); return $link; } /** * Custom comments list * * @since Outdoor 1.0 */ if (!function_exists('outdoor_comments')) { function outdoor_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); if ('div' == $args['style']) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> <<?php echo esc_attr($tag); ?> <?php comment_class(empty($args['has_children']) ? 'media clearfix' : 'media parent clearfix') ?> id="comment-<?php comment_ID() ?>"> <?php if ('div' != $args['style']): ?> <div id="div-comment-<?php comment_ID() ?>" class="comment-body"> <?php endif; ?> <div class="comment-author"> <?php if ($args['avatar_size'] != 0) echo get_avatar($comment, $args['avatar_size']); ?> </div> <cite class="fn"><a href="#"><?php echo get_comment_author_link($comment->comment_ID); ?></a></cite> <div class="comment-meta"> <h6><a href="#"><?php echo get_comment_date(esc_html__('F j, Y g:i a', 'outdoor')); ?></a> / <?php comment_reply_link(array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?></h6> </div> <?php comment_text(); ?> <?php if ($comment->comment_approved == '0'): ?> <em class="comment-awaiting-moderation aligncenter"><?php esc_html_e('Your comment is awaiting moderation.', 'outdoor'); ?></em> <br /> <?php endif; ?> <?php if ('div' != $args['style']): ?> </div> <?php endif; ?> <?php } } /** * Modify tag cloud format * * @since Outdoor 1.0 */ function outdoor_custom_tag_cloud_widget($args) { $args['format'] = 'list'; //ul with a class of wp-tag-cloud return $args; } add_filter('widget_tag_cloud_args', 'outdoor_custom_tag_cloud_widget'); // add_filter( 'woocommerce_product_tag_cloud_widget_args','outdoor_custom_tag_cloud_widget'); /** * Modify password form * * @since Outdoor 2.3 */ function outdoor_password_form() { global $post; if( has_post_thumbnail( $post->ID ) && outdoor_get_option('passpost_featuredimg') ){ $ptn = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); }else{ $ptn = outdoor_global_var('bgpasspost', 'url', true); } $label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID ); //$o = '<!--=============== background ===============-->'; $o = '<div class="full-height-wrap fixed-wrap postpass-bg-wrap">'; $o .= '<div class="bg" style="background-image:url('.esc_url( $ptn ).')"></div>'; $o .= '<div class="overlay op4"></div>'; $o .= '</div>'; //$o .= '<!--background end -->'; //$o .= '<!--=============== custom-inner ===============-->'; $o .= '<div class="custom-inner postpass-page">'; $o .= '<div class="container">'; if( outdoor_get_option('passpost_title') ){ $o .= '<h2>'.get_the_title($post->ID).'</h2>'; } $o .= wp_kses_post( outdoor_get_option('passpost_intro') ); $o .= '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post" class="postpass_form">'; $o .= '<p><strong>'.esc_html_x( "To view this gallery, enter the password below.",'postpass form', 'outdoor' ) . '</strong></p>'; //$o .= '<label for="' . $label . '">' . __( "Password:" ) . ' </label>'; $o .= '<div class="passpost-input-wrapp"><input name="post_password" id="' . $label . '" type="password" size="20" maxlength="20" class="passpost-input" placeholder="'.esc_html_x('Password','postpass form','outdoor').'"></div>'; $o .= '<div class="passpost-submit-wrapp"><button type="submit" class="btn anim-button trans-btn wt-btn transition passpost-submit" >' . wp_kses(__('<span>Authenticate</span><i class="fa fa-unlock"></i>', 'outdoor'), array('span'=>array(),'i'=>array('class'=>array())) ) . '</button></div>'; $o .= '</form>'; $o .= '</div>'; $o .= '</div>'; //$o .= '<!-- custom-inner end -->'; return $o; } add_filter( 'the_password_form', 'outdoor_password_form' ); function outdoor_protected_post_prepend(){ return esc_html_x('%s', 'protected prepend','outdoor'); } add_filter('protected_title_format','outdoor_protected_post_prepend' ); /** * Return attachment image link by using wp_get_attachment_image_src function * * @since Outdoor 2.4 */ function outdoor_get_attachment_thumb_link( $id, $size = 'thumbnail', $icon = false ){ $image_attributes = wp_get_attachment_image_src( $id, $size, $icon ); if ( $image_attributes ) { return $image_attributes[0]; } return ''; } function outdoor_get_folio_load_more_link(){ global $post; global $wp; if(is_front_page()) { $more_url = home_url( add_query_arg(array(),$wp->request) . '/page/' ); } else { $more_url = home_url( add_query_arg(array(),$wp->request) . '/page/' ); } // $more_url = get_permalink( $post->ID ) ; return $more_url; } /** * Reorder comment field output * * @since Outdoor 3.0 */ function outdoor_remove_comment_field($string) { return ''; } //add_filter( 'comment_form_field_comment', 'outdoor_remove_comment_field' ); /** * Then add comment field after * * @since Outdoor 3.0 */ function outdoor_add_comment_field_after() { //$commenter = wp_get_current_commenter(); $req = get_option( 'require_name_email' ); $aria_req = ( $req ? " aria-required='true'" : '' ); echo '<div class="clearfix"></div><div class="comment-form-comment control-group"><div class="controls"><textarea placeholder="'.esc_html__('Your comment here...','outdoor').'" id="comment" cols="50" rows="8" name="comment" '.$aria_req.'></textarea></div></div><div class="clearfix"></div>'; } //add_filter( 'comment_form_after_fields', 'outdoor_add_comment_field_after' ); //add_filter( 'comment_form_logged_in_after', 'outdoor_add_comment_field_after' ); /** * Additional features to allow styling of the templates. */ require get_parent_theme_file_path( '/includes/template-functions.php' ); /** * Custom meta box for page, post, portfolio... * * @since Outdoor 1.0 */ require_once get_template_directory() . '/cmb2/functions.php'; /** * Visual Composer plugin integration * * @since Outdoor 1.0 */ // require_once get_template_directory() . '/inc/cth_for_vc.php'; /** * Theme custom style * * @since Outdoor 1.0 */ require_once get_template_directory() . '/inc/overridestyle.php'; /** * Taxonomy meta box * * @since Outdoor 1.0 */ require_once get_template_directory() . '/inc/cth_taxonomy_fields.php'; require_once get_template_directory() . '/inc/category_metabox_fields.php'; require_once get_template_directory() . '/inc/tag_metabox_fields.php'; require_once get_template_directory() . '/inc/product_cat_metabox_fields.php'; require_once get_template_directory() . '/inc/product_tag_metabox_fields.php'; /** * Custom elements for VC * * @since Outdoor 1.0 */ // require_once get_template_directory() . '/vc_extend/vc_shortcodes.php'; /** * Implement the One Click to import demo data * * @since Outdoor 1.0 */ require_once get_template_directory() . '/includes/one-click-import-data.php'; require_once get_template_directory() . '/inc/ajax.php'; require_once get_template_directory() . '/inc/init.php'; /** * This file represents an example of the code that themes would use to register * the required plugins. * * It is expected that theme authors would copy and paste this code into their * functions.php file, and amend to suit. * * @see http://tgmpluginactivation.com/configuration/ for detailed documentation. * * @package TGM-Plugin-Activation * @subpackage Example * @version 2.5.2 * @author Thomas Griffin, Gary Jones, Juliette Reinders Folmer * @copyright Copyright (c) 2011, Thomas Griffin * @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later * @link https://github.com/TGMPA/TGM-Plugin-Activation */ /** * Include the TGM_Plugin_Activation class. */ require_once get_template_directory() . '/framework/class-tgm-plugin-activation.php'; add_action('tgmpa_register', 'outdoor_register_required_plugins'); /** * Register the required plugins for this theme. * * In this example, we register five plugins: * - one included with the TGMPA library * - two from an external source, one from an arbitrary source, one from a GitHub repository * - two from the .org repo, where one demonstrates the use of the `is_callable` argument * * The variables passed to the `tgmpa()` function should be: * - an array of plugin arrays; * - optionally a configuration array. * If you are not changing anything in the configuration array, you can remove the array and remove the * variable from the function call: `tgmpa( $plugins );`. * In that case, the TGMPA default settings will be used. * * This function is hooked into `tgmpa_register`, which is fired on the WP `init` action on priority 10. */ function outdoor_register_required_plugins() { /* * Array of plugin arrays. Required keys are name and slug. * If the source is NOT from the .org repo, then source is also required. */ $plugins = array( // This is an example of how to include a plugin from a private repo in your theme. array('name' => esc_html__('Redux Framework','outdoor'), // The plugin name. 'slug' => 'redux-framework', // The plugin source. 'required' => true, // If false, the plugin is only 'recommended' instead of required. 'external_url' => esc_url('https://wordpress.org/plugins/redux-framework/'), // If set, overrides default API URL and points to an external URL. ), array('name' => esc_html__('WPBakery Page Builder','outdoor'), // The plugin name. 'slug' => 'js_composer', // The plugin slug (typically the folder name). 'source' => 'http://assets.cththemes.com/plugins/js_composer.zip', // The plugin source. 'required' => true, 'external_url' => esc_url('https://codecanyon.net/item/visual-composer-page-builder-for-wordpress/242431' ), // If set, overrides default API URL and points to an external URL. ), array('name' => esc_html__('Slider Revolution','outdoor' ), // The plugin name. 'slug' => 'revslider', // The plugin slug (typically the folder name). 'source' => 'http://assets.cththemes.com/plugins/revslider.zip', // The plugin source. 'required' => true, // If false, the plugin is only 'recommended' instead of required. 'external_url' => esc_url('https://codecanyon.net/item/slider-revolution-responsive-wordpress-plugin/2751380'), ), array( 'name' => esc_html__('Contact Form 7','outdoor'), // The plugin name. 'slug' => 'contact-form-7', // The plugin slug (typically the folder name). 'required' => true, // If false, the plugin is only 'recommended' instead of required. 'external_url' => esc_url('https://wordpress.org/plugins/contact-form-7/' ), // If set, overrides default API URL and points to an external URL. ), array('name' => esc_html__('CMB2','outdoor'), // The plugin name. 'slug' => 'cmb2', // The plugin slug (typically the folder name). 'required' => true, // If false, the plugin is only 'recommended' instead of required. 'external_url' => esc_url('https://wordpress.org/plugins/cmb2/'), // If set, overrides default API URL and points to an external URL. ), array('name' => esc_html__('Outdoor Add-ons','outdoor' ), // The plugin name. 'slug' => 'outdoor-add-ons', // The plugin slug (typically the folder name). 'source' => 'outdoor-add-ons.zip', // The plugin source. 'required' => true, // If false, the plugin is only 'recommended' instead of required. ), array('name' => esc_html__('WooCommerce','outdoor' ), // The plugin name. 'slug' => 'woocommerce', // The plugin slug (typically the folder name). //'source' => 'https://downloads.wordpress.org/plugin/woocommerce.2.6.4.zip', // The plugin source. 'required' => true, // If false, the plugin is only 'recommended' instead of required. 'external_url' => esc_url('https://wordpress.org/plugins/woocommerce/'), ), array( 'name' => esc_html__('Envato Market','outdoor' ), // The plugin name. 'slug' => 'envato-market', // The plugin slug (typically the folder name). 'source' => esc_url('http://envato.github.io/wp-envato-market/dist/envato-market.zip' ), // The plugin source. 'required' => true, // If false, the plugin is only 'recommended' instead of required. 'external_url' => esc_url('http://envato.github.io/wp-envato-market/' ), // If set, overrides default API URL and points to an external URL. ), array('name' => esc_html__('One Click Demo Import','outdoor'), // The plugin name. 'slug' => 'one-click-demo-import', // The plugin slug (typically the folder name). 'required' => true, // If false, the plugin is only 'recommended' instead of required. 'external_url' => esc_url('https://wordpress.org/plugins/one-click-demo-import/'), // If set, overrides default API URL and points to an external URL. ), array('name' => esc_html__('Regenerate Thumbnails','outdoor'), // The plugin name. 'slug' => 'regenerate-thumbnails', // The plugin slug (typically the folder name). 'required' => false, // If false, the plugin is only 'recommended' instead of required. 'external_url' => esc_url('https://wordpress.org/plugins/regenerate-thumbnails/' ), // If set, overrides default API URL and points to an external URL. ), ); /* * Array of configuration settings. Amend each line as needed. * * TGMPA will start providing localized text strings soon. If you already have translations of our standard * strings available, please help us make TGMPA even better by giving us access to these translations or by * sending in a pull-request with .po file(s) with the translations. * * Only uncomment the strings in the config array if you want to customize the strings. */ $config = array( 'id' => 'outdoor', // Unique ID for hashing notices for multiple instances of TGMPA. 'default_path' => get_template_directory() . '/framework/plugins/', // Default absolute path to bundled plugins. 'menu' => 'tgmpa-install-plugins', // Menu slug. 'has_notices' => true, // Show admin notices or not. 'dismissable' => true, // If false, a user cannot dismiss the nag message. 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag. 'is_automatic' => false, // Automatically activate plugins after installation or not. 'message' => '', // Message to output right before the plugins table. ); tgmpa( $plugins, $config ); }
| ver. 1.4 |
Github
|
.
| PHP 8.2.31 | Generation time: 0.25 |
proxy
|
phpinfo
|
Settings