• Resolved ShdMstr

    (@shdmstr)


    Long story short – I’m trying to build a custom post type gallery and I think i figure it out almost everything but the call in the template, I already have the custom post type in the functions.php I created many post, I have a Page with a custom call to the post type and it’s working (the post are showing in the page with the template) what I cannot figure it out it’s the call for the href that should go to open the image bigger probably with some modal like lightbox or something like that.
    Before saying anything I do not want to use the gallery functions build in wordpress I want to be able to customize the css as much as I want building an unordered list with different classes.
    I have to mention that I’m trying to use feature image and already have created some image sizes for it in the functions.php, I’m going to paste the code for you to understand… Thank you in advance

    Code:
    Custom-post-type-template —-

    <?php
    	/*      Template Name: Test Post Type Gallery	*/
    get_header(); ?>
    		<div id="container">
    			<div id="content" role="main">
    <?php $loop = new WP_Query( array( 'post_type' => 'bird', 'posts_per_page' => 10 ) ); ?>
    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
    				<ul class="gallery-ul">
    					<li class="the-picture"><?php the_title( '<h2 class="picture-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h2>' ); ?>
    					<a <strong>href="-----?????????--------"></strong> <?php the_post_thumbnail(array(200,200)); ?></a></li>
    				</ul>
    <?php endwhile; ?>
    			</div><!-- #content -->
    		</div><!-- #container -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Functions.php — This is for the Size of the Images

    if ( function_exists( 'add_theme_support' ) ) {
    	add_theme_support( 'post-thumbnails' );
    	set_post_thumbnail_size( 250, 250, true ); // Normal post thumbnails
    	add_image_size( 'medium-picture-thumbnail', 400, 400 ); // Medium thumbnail size
    	add_image_size( 'big-picture-thumbnail', 700, 700 ); // Big thumbnail size
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Custom Type Gallery Question’ is closed to new replies.