Created
November 15, 2018 18:32
-
-
Save hborrelli1/7ce6e967ca9999653187ed501cdf31f5 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* Archive pages. | |
* | |
* @package The7 | |
* @since 1.0.0 | |
*/ | |
// File Security Check | |
if ( ! defined( 'ABSPATH' ) ) { exit; } | |
$config = presscore_config(); | |
$config->set( 'template', 'page' ); | |
$config->set( 'layout', 'masonry' ); | |
$config->set( 'template.layout.type', 'masonry' ); | |
get_header('archive_dspe_gallery'); | |
?> | |
<div class="gallery-archive-intro"> | |
<div class="intro-content"> | |
<p>Most apparel decorators claim to have the highest quality, fastest turn-around and lowest prices. We’re very proud of our quality, our customer service and know what it takes to be successful in our market since 1983. Below is a sample of what we do and how we do it.</p> | |
<div class="down-arrow"> | |
<span class="arrow"></span> | |
</div> | |
</div> | |
</div> | |
<!-- Content --> | |
<div id="content" class="content" role="main"> | |
<?php | |
// You might need to use wp_reset_query(); | |
// here if you have another query before this one | |
global $post; | |
// The query arguments | |
$args = array( | |
'posts_per_page' => 6, | |
'order' => 'DESC', | |
'orderby' => 'ID', | |
'post_type' => 'dspe_gallery', | |
'post__not_in' => array( $post->ID ) | |
); | |
// Create the related query | |
$rel_query = new WP_Query( $args ); | |
// Check if there is any related posts | |
if( $rel_query->have_posts() ) : | |
?> | |
<div class="portfolio-filter"> | |
<h4 class="small-caps-title gold">Portfolio</h4> | |
</div> | |
<div id="gallery_arch_list_wrap"> | |
<ul class="list"> | |
<?php | |
// The Loop | |
while ( $rel_query->have_posts() ) : | |
$rel_query->the_post(); | |
$category = get_the_category( $post->ID ); | |
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' ); | |
?> | |
<li> | |
<a href="<?php the_permalink() ?>" title="<?php the_title() ?>" rel="bookmark"> | |
<div class="arch-post" style="background-image:url('<?php echo $thumb[0]; ?>');"> | |
<!-- <img src="<?php// echo $thumb[0]; ?>" alt=""> --> | |
<div class="post-info"> | |
<div class="category"><?php echo $category[0]->cat_name; ?></div> | |
<h4 class="entry-title"><?php the_title() ?></h4> | |
</div> | |
</div> | |
</a> | |
</li> | |
<?php | |
endwhile; | |
?> | |
</ul><!-- .group --> | |
</div><!-- #more-work-wrap --> | |
<?php | |
endif; | |
// Reset the query | |
// wp_reset_query(); | |
?> | |
</div><!-- #content --> | |
<?php do_action( 'presscore_after_content' ) ?> | |
<?php get_footer('dspe_gallery') ?> |
This file contains 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 | |
/** | |
* Your code here. | |
* | |
*/ | |
/* Adding SVG's to WP */ | |
function add_file_types_to_uploads($file_types){ | |
$new_filetypes = array(); | |
$new_filetypes['svg'] = 'image/svg+xml'; | |
$file_types = array_merge($file_types, $new_filetypes ); | |
return $file_types; | |
} | |
add_action('upload_mimes', 'add_file_types_to_uploads'); | |
/* End of Adding SVG's to WP */ | |
/******************************************** | |
# - Custom Post Types | |
*********************************************/ | |
add_action( 'init', 'codex_book_init' ); | |
/** | |
* Register a gallery post type. | |
* | |
* @link http://codex.wordpress.org/Function_Reference/register_post_type | |
*/ | |
function codex_book_init() { | |
$labels = array( | |
'name' => _x( 'Gallery', 'post type general name', 'the7dtchild' ), | |
'singular_name' => _x( 'DSPE_Gallery', 'post type singular name', 'the7dtchild' ), | |
'menu_name' => _x( 'Gallery', 'admin menu', 'the7dtchild' ), | |
'name_admin_bar' => _x( 'Gallery', 'add new on admin bar', 'the7dtchild' ), | |
'add_new' => _x( 'Add New', 'gallery item', 'the7dtchild' ), | |
'add_new_item' => __( 'Add New Gallery Item', 'the7dtchild' ), | |
'new_item' => __( 'New Gallery Item', 'the7dtchild' ), | |
'edit_item' => __( 'Edit Gallery Item', 'the7dtchild' ), | |
'view_item' => __( 'View Gallery Item', 'the7dtchild' ), | |
'all_items' => __( 'All Gallery Items', 'the7dtchild' ), | |
'search_items' => __( 'Search Gallery', 'the7dtchild' ), | |
'parent_item_colon' => __( 'Parent Gallery:', 'the7dtchild' ), | |
'not_found' => __( 'No gallery item found.', 'the7dtchild' ), | |
'not_found_in_trash' => __( 'No gallery item found in Trash.', 'the7dtchild' ) | |
); | |
$args = array( | |
'labels' => $labels, | |
'description' => __( 'Description.', 'the7dtchild' ), | |
'public' => true, | |
'publicly_queryable' => true, | |
'show_ui' => true, | |
'show_in_menu' => true, | |
'query_var' => true, | |
'rewrite' => array( 'slug' => 'gallery' ), | |
'capability_type' => 'post', | |
'has_archive' => true, | |
'hierarchical' => true, | |
'menu_position' => null, | |
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'page-attributes', 'post_formats' ), | |
'taxonomies' => array( 'category','post_tag' ) | |
); | |
register_post_type( 'dspe_gallery', $args ); | |
} | |
/******************************************** | |
# - End of Custom Post Types | |
*********************************************/ | |
/* Adding page options to Custom Post Type */ | |
function add_dt_metaboxes_custom( $pages ) { | |
$pages[] = 'dspe_gallery'; | |
return $pages; | |
} | |
add_filter( 'presscore_pages_with_basic_meta_boxes', 'add_dt_metaboxes_custom' ); | |
/* End of Adding page options to Custom Post Type */ | |
This file contains 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 | |
/** | |
* Header template. | |
* | |
* @package The7 | |
* @since 1.0.0 | |
*/ | |
// File Security Check | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
get_template_part( 'header-single' ); | |
get_template_part( 'header-main-archive_dspe_gallery' ); | |
// Little trick! | |
// wp_head() |
This file contains 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 | |
/** | |
* Header template part with main container opener. | |
* | |
* @package The7 | |
* @since 1.0.0 | |
*/ | |
// File Security Check | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
?> | |
<?php do_action( 'presscore_before_main_container' ) ?> | |
<?php if ( presscore_is_content_visible() ): ?> | |
<!-- Gallery Header Wrap --> | |
<div class="gallery-archive-hero-wrap"> | |
<div class="hero-content"> | |
<h1 class="small-caps-title gold">Gallery</h1> | |
<h2>See the Work For Yourself</h2> | |
</div> | |
</div> | |
<div id="main" <?php presscore_main_container_classes() ?> <?php presscore_main_container_style() ?> > | |
<?php do_action( 'presscore_main_container_begin' ) ?> | |
<div class="main-gradient"></div> | |
<div class="wf-wrap"> | |
<div class="wf-container-main dspe_gallery-container"> | |
<?php do_action( 'presscore_before_content' ) ?> | |
<?php endif ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment