post_excerpt ? $the_post->post_excerpt : $the_post->post_content; } $the_excerpt = strip_tags(strip_shortcodes($the_excerpt)); //Strips tags and images $words = explode(' ', $the_excerpt, $excerpt_length + 1); if (count($words) > $excerpt_length) : array_pop($words); array_push($words, '…'); $the_excerpt = implode(' ', $words); endif; return $the_excerpt; } // Post Share require_once ('post-share.php'); // Page List function restly_page_list() { $args = wp_parse_args( array( 'post_type' => 'page', 'numberposts' => -1, ) ); $posts = get_posts( $args ); $post_options = array( esc_html__( '-- Select Page --', 'restlycore' ) => '' ); if ( $posts ) { foreach ( $posts as $post ) { $post_options[$post->ID] = $post->post_title; } } return $post_options; } //Portfolio Category function restly_portfolio_cat_list(){ $terms = get_terms( array( 'taxonomy' => 'restly_portfolio_cat', 'hide_empty' => true, )); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ foreach ( $terms as $term ) { $options[ $term->name ] = $term->name; } } return $options; } function restly_portfolio_cat_id(){ $terms = get_terms( array( 'taxonomy' => 'restly_portfolio_cat', 'hide_empty' => true, )); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ foreach ( $terms as $term ) { $options[ $term->term_id ] = $term->name; } } return $options; } // Woocommerce Product Category if( !function_exists( 'restly_woo_cat_id' ) ) { function restly_woo_cat_id(){ $terms = get_terms( array( 'taxonomy' => 'product_cat', 'hide_empty' => false, )); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ foreach ( $terms as $term ) { $options[ $term->term_id ] = $term->name; } } return $options; } } if( !function_exists( 'restly_woo_cat_name' ) ) { function restly_woo_cat_name(){ $terms = get_terms( array( 'taxonomy' => 'product_cat', 'hide_empty' => false, )); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ foreach ( $terms as $term ) { $options[ $term->name ] = $term->name; } } return $options; } } // Custom paginations Start if ( !function_exists( 'restly_paginate_nav' ) ): function restly_paginate_nav( $restlyQuery = null ) { if ( empty( $restlyQuery ) ): $restlyQuery = $GLOBALS['wp_query']; endif; // Don't print empty markup if there's only one page. if ( $restlyQuery->max_num_pages < 2 ) { return; } $paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1; $pagenum_link = html_entity_decode( get_pagenum_link() ); $query_args = array(); $url_parts = explode( '?', $pagenum_link ); if ( isset( $url_parts[1] ) ) { wp_parse_str( $url_parts[1], $query_args ); } $pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link ); $pagenum_link = trailingslashit( $pagenum_link ) . '%_%'; $format = $GLOBALS['wp_rewrite']->using_index_permalinks() && !strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; $format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%'; // Set up paginated links. $links = paginate_links( array( 'base' => $pagenum_link, 'format' => $format, 'total' => $restlyQuery->max_num_pages, 'current' => $paged, 'add_args' => array_map( 'urlencode', $query_args ), 'prev_text' => '', 'next_text' => '', 'type' => 'array', ) ); if ( $links ): ?>
' . $notice_message . '