This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global $post,$paged; | |
| $paged = get_query_var('paged') ? get_query_var('paged') : 1; | |
| $display_count = '10'; | |
| $wpex_query = new WP_Query( | |
| array( | |
| 'post_type' => 'portfolio', | |
| 'posts_per_page => $display_count, | |
| 'paged' => $paged | |
| ) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function wpex_order_portfolio( $query ) { | |
| // exit out if it's the admin or it isn't the main query | |
| if ( is_admin() || ! $query->is_main_query() ) { | |
| return; | |
| } | |
| // order portfolio archive by title in ascending order | |
| if ( is_post_type_archive( 'portfolio' ) ) { | |
| $query->set( 'order' , 'asc' ); | |
| $query->set( 'orderby', 'title'); | |
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget sapien libero, nec scelerisque urna. In mi ante, iaculis sed sollicitudin id, egestas sit amet lacus. Donec adipiscing dolor eget eros porttitor in aliquet est pharetra. This is just your regular post content, obviously you can put anything you want here and the double border below is the hr shortcode. | |
| [hr] | |
| [column size="half" position="first"] | |
| [contact-form-7 id="303" title="Untitled"] | |
| [/column] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function wpex_post_featured_image() { | |
| global $post; | |
| if ( !has_post_thumbnail( $post->ID ) ) return; | |
| if ( !get_theme_mod( 'wpex_blog_post_thumb', '1' ) ) return; | |
| if ( 'on' == get_post_meta( $post->ID, 'wpex_disable_featured_image', true ) ) return; ?> | |
| <div class="post-thumbnail"> | |
| <a href="<?php echo wp_get_attachment_url(get_post_thumbnail_id()); ?>" title="View Full Image"><img src="<?php echo wpex_get_featured_img_url(); ?>" alt="<?php echo esc_attr( the_title_attribute( 'echo=0' ) ); ?>" /></a> | |
| </div><!-- .post-thumbnail --> | |
| <?php | |
| } // End function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function my_attachments_search( $query ) { | |
| if ( !is_search() ) | |
| return $query; | |
| $post_types = $query->get( 'post_type' ); | |
| if ( ! $post_types || 'post' == $post_types ) | |
| $post_types = array( 'post', 'attachment' ); | |
| if ( is_array( $post_types ) ) | |
| $post_types[] = 'attachment'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Remove the slug from published post permalinks for our custom post types. | |
| */ | |
| add_filter( 'post_type_link', function( $post_link, $post, $leavename ) { | |
| $post_types = array( | |
| 'post_type_1', | |
| 'post_type_2' | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ( ! function_exists( 'wpex_sidebar_display' ) ) { | |
| function wpex_sidebar_display() { | |
| if ( is_front_page() ) return true; // Display sidebar on homepage no matter what. | |
| if ( is_singular() ) { | |
| global $post; | |
| $post_layout = get_post_meta( $post->ID, 'wpex_post_layout', true ); | |
| if ( '' == $post_layout ) return true; | |
| if ( 'right-sidebar' == $post_layout || 'left-sidebar' == $post_layout ) { | |
| return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| get_post_meta( get_post_thumbnail_id( get_the_ID() ), '_wp_attachment_image_alt', true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Remove the slug from portfolio post type | |
| function vipx_remove_cpt_slug( $post_link, $post, $leavename ) { | |
| if ( ! in_array( $post->post_type, array( 'portfolio' ) ) || 'publish' != $post->post_status ) | |
| return $post_link; | |
| $post_link = str_replace( '/'. wpex_option('portfolio_slug','portfolio-item') .'/', '/', $post_link ); | |
| return $post_link; | |
| } | |
| add_filter( 'post_type_link', 'vipx_remove_cpt_slug', 10, 3 ); | |
| function vipx_parse_request_tricksy( $query ) { | |
| // Only noop the main query |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <FilesMatch ".(ttf|otf|eot|woff)$"> | |
| <IfModule mod_headers.c> | |
| Header set Access-Control-Allow-Origin "*" | |
| </IfModule> | |
| </FilesMatch> |