• After reading a buch of the documents I still cant figure out how to this. I want the text written in the text field of the “page” in the admin to be included in my custom page template. I would assume some kind of “tag”?

    Cheers!

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter browncoat

    (@browncoat)

    hmm “Displays the contents of the current post” make me confused, its a page text i want displayed (textfield for the page), not a post.

    the_content() will work on pages, too.

    Have you looked at the page.php included with the Twentyten theme? That might help, to see how that template is structured, and the functions it uses.

    Thread Starter browncoat

    (@browncoat)

    Thank you suzanne, I have looked at the page.php for the Twentyten theme, activating that theme writes out the page text OK, but when I insert the tag <?php the_content(); ?> in my templeate nothing is written out (even checked source view). Strange :S

    Can you post a link? I’m not sure I’ll be able to help, but being able to see specifically might let someone else help more quickly.

    you could share the code of your template here by pasting it into a https://wordpress.pastebin.com/and posting the link to it here.

    also, a link to your site might help to illustrate the issue.

    Thread Starter browncoat

    (@browncoat)

    Unforunately I have wordpress installed localy using xampp during learning/testing and my router cant be configured to allow outside access ??

    But here’s the template, nothing to it really.

    <?php
    /*
    Template Name: Org.Page
    */
    ?>
    
    <?php get_header(); ?>
    
    <div id="pageContent">
    	<div class="contentContainer">
    		<div class="rightSectionOne">
    		<h1>F?reningen</h1>
    			<div class="hrLine"></div>
    			<?php the_content(); ?>
    		</div>
    
    		<div class="fixedPhotoFrame">
    			<div><h4>Styrelsen</h4></div>
    			<img src="images/khfg_group.jpg" />
    			<div class="descriptionBox">
    			Fr?n v?nster: ppl names.
    			</div>
    		</div>
    	</div>
    
    </div>
    
    <?php get_footer(); ?>
    Thread Starter browncoat

    (@browncoat)

    the_content() needs to be used in the loop – see docu i already linked to.

    Thread Starter browncoat

    (@browncoat)

    ahh super, thanks ??

    Thread Starter browncoat

    (@browncoat)

    I wonder if I might have some pointers as to what I’m doing wrong regarding a related issue, would be much apprechiated.

    I have set the “posts page” (Settings > Reading) to the page “News” and the template attribute for that page have been set to “News page” (page_news.php).

    Now when I have included the loop to fetch the posts nothing shows up, how come? Loop code have been copied from the codex.

    https://wordpress.pastebin.com/C36zYqbq

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Your designated posts page will use your theme’s index.php template file – irrespective of any custom template you might have assigned to the page.

    Thread Starter browncoat

    (@browncoat)

    Thank you for clearing that up for me.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘WordPress tag for including text in page template?’ is closed to new replies.