• Hello all,

    I hope someone can help me with this problem.

    I have this overview page set up in wordpress with my own theme. In this page I list some custom post types, all of them have a post (so there is content and stuff).

    The list of custom post types are all links to the post pages of these CPT’s. This all works as it should.

    But, what I am trying to do is have these links open in a div on the right side of the same page. And have them show up when a user clicks on the corresponding link.

    I have tried it using tooltips but this didn’t give me the content of the post and the thumbnail.

    Javascript or php? Anyone…

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Sorry no help as I am looking at this as well. I tried a lightbox but it gives me the whole webpage not just the post content.

    Thread Starter Wouters

    (@wouters)

    Well I fixed this problem a some time ago. At first I used a Java script to get the content to load in a div on the same page. But, while it worked, did not do the job for me.

    I now have fancybox open the page. Just do this, for your single(-posttype).php file. This will not load the header and footer but will load the content:

    <?php the_post(); ?>
    
    <section id="inclusief" style="margin-top:15px;">
    		<div class="col-sm-5 mobile">
    			<h1 class="extra-title"><?php the_title(); ?></h1>
    				<div class="tabcontent" id="tab-<?php the_ID(); ?>">
    					<p><?php the_content(); ?></p>
    			</div>
    		</div>
    		<div class="col-sm-1"></div>
    		<div class="col-sm-6 no-padding">
    			<div class="incl">
    				<?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?>
    			</div>
    		</div>
    	</div>
    </section>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘On link click show post content in div on same page’ is closed to new replies.