• I wanted to know how to add the shortcode to php page so that when one click on a post, a lightbox will show up with post content and you can go back and forth to next post in the lightbox…

    This is my actual post loop in a page

    <?php if ( $the_query->have_posts() ) : ?>
    <?php
    // the loop
    while ( $the_query->have_posts() ) : $the_query->the_post();
    ?>
    <div class="proyectpost">
                <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
                <div class="innerpost">
                <a href="<?php the_permalink(); ?>" title="Permanent Link to <?php the_title_attribute(); ?>">
                <?php
            	// Get post meta that is already set
            	$custom_values = get_post_meta($post->ID, 'en_proceso_class', true);
        		?>
                 <div class="postthumbnail <?php echo $custom_values; ?>">
                <?php if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
    	$image_src = wp_get_attachment_image_src( get_post_thumbnail_id(),'full' );
         echo '<img src="' . $image_src[0]  . '" width="100%"  />';
    	} ?>
        		</div>
                <div class="posttitle">
    		<h2><?php the_title(); ?></h2>
            <span><?php echo get_post_meta($post->ID, 'location', true); ?></span>
    			</div><!-- .entry-header -->
     			</a>
    </div>
    </article><!-- #post-## -->
    </div>
    <?php endwhile; ?>

    https://www.ads-software.com/plugins/wp-colorbox/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Adding shortcode to php page’ is closed to new replies.