• Resolved camzaytie

    (@camzaytie)


    Hi,
    I’m trying to make condition in which if the page is sales inquiries,
    there’s an include php page but it doesn’t let me show:

    <div id="full_contents" class="right">
    
    	<?php if(have_posts()) : ?>
    		<?php while(have_posts()) : the_post(); ?>
    			<?php the_content(); ?>
    
    			<?php if(is_page('sales-enquiries')):?>
    				<?php include 'sales-enquiry.php'; ?>
    			<?php endif;?>
    
    	<?php endwhile; ?>
    	<?php endif; ?>
    
    </div>

    I wonder what’s wrong ;(

Viewing 9 replies - 1 through 9 (of 9 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    What won’t show?

    Thread Starter camzaytie

    (@camzaytie)

    It should be like this:

    http://i48.tinypic.com/14b1e12.jpg

    Because I am going to make a seperate php file for our sales inquiry form.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you var dump something within that if statement, to make sure you’re getting in?

    Thread Starter camzaytie

    (@camzaytie)

    right after the text from the contents,
    the include file should also appear on the page 🙁
    I don’t know which part I got wrong

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    To narrow it down, can you exit(); inside of your if statement and let us know whether the page turns white?

    Thread Starter camzaytie

    (@camzaytie)

    the background of the full content cut off as well as the footer

    <div id="full_contents" class="right">
    
    	<?php if(have_posts()) : ?>
    		<?php while(have_posts()) : the_post(); ?>
    			<?php the_content(); ?>
    
    			<?php if(is_page('sales-enquiries')):?>
    				<?php include 'sales-enquiry.php'; ?>
    				 <?php exit();?>
    			<?php endif;?>
    
    	<?php endwhile; ?>
    	<?php endif; ?>
    
    </div>
    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Remove the exit();.

    Within your include url, try a more specific path.
    E.g
    wp-content/themes/yourTheme/sales-enquiry.php

    Thread Starter camzaytie

    (@camzaytie)

    weeeeeeeee <3 <3 <3

    Thread Starter camzaytie

    (@camzaytie)

    wow -.- I checked again what seems to be the problem.. haha..
    is because the page-default.php is in another folder, no wonder that the sales-enquiry.php doesn’t show :<

    http://i50.tinypic.com/mcrak9.png

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Include external php page inside a page.php’ is closed to new replies.