SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    calling in a specific page

    Wow...quite today. Hope everyone is out enjoying the nice weather...& of course hope where ever you all are...you have nice weather.
    Now for wp. I am trying to call in a page. show the page.

    Code:
    get_template_part( 'featured-content' );
    I tried
    Code:
    <?php
    			if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
    				// Include the featured content template.
    				get_template_part( 'contact-us' );
    			}
    		?>
    			<div id="primary" class="content-area">
    				<div id="content" class="site-content" role="main">
    
    					<?php
    						// Start the Loop.
    						while ( have_posts() ) : the_post();
    
    							// Include the page content template.
    							get_template_part( 'content', 'page' );
    
    							// If comments are open or we have at least one comment, load up the comment template.
    							//if ( comments_open() || get_comments_number() ) {
    								//comments_template();
    							//}
    						endwhile;
    					?>
    &
    Code:
    while ( have_posts() ) : the_post('contact-us');
    so far nothing is working. Does anyone know the right way to bring in that page?
    thank you
    D

  2. #2
    SitePoint Member
    Join Date
    May 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi pdxSherpa,

    Is contact-us a custom page template or part of a template that can be included by calling it from the index file? If it's a custom page template create a php file and add this comment at the very top:

    Code:
    <?php
    /*
    Template Name: Contact Us Page
    */
    Save it as contact-us.php and apply it when you create/edit your page in the Pages admin panel by selecting it from the Template dropdown.

    On the other hand, if you want to include a portion of content by calling it from the index.php document, you could create a content-contact.php file and call it inside the loop using

    Code:
    <?php while ( have_posts() ) : the_post(); ?>
    
       <?php	get_template_part('content' 'contact' ); ?>
    
    <?php endwhile; ?>
    I hope this helps

  3. #3
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thank Antonella, i'll give it shot...i think i had tried that but not sure now!
    am going to try and use plug in for a form and then called that specific page in
    thx
    d

  4. #4
    SitePoint Member
    Join Date
    May 2010
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi D., keep me posted, I hope it works.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •