Wordpress help please!

by danb12
14 replies
  • WEB DESIGN
  • |
Hello

Really could do with some help.

Setting up a WordPress, and im stuck!!

im adding pages but putting the same info in for all pages (boring)

I want to set up a default page template so when i create a new page the text i need is already there in the same places for all pages.

This is what I mean:
discountsrus[dot]co[dot]uk/loans-rus/?page_id=30

Every thing in bold, such as APR Loan Amount etc... I want the text already there so i can just input the info needed.

If you have a look at other pages i can not get the formatting right so its the same place in all pages.

How could i do this? Is it possible to do?

Thanks
#wordpress
  • Profile picture of the author Eric S
    I'm not 100% sure if this is the easiest way, but it might help.

    Open up notepad and copy and paste this at the top.

    <?php /* Template Name: template name here */ ?>

    Then, copy your entire page code, whether html or php, below that.

    Save that as a .php file.

    Upload that file into your wp-content/themes/ folder under the theme that you're using.

    Then, when you create a new page, you will see a field titled template (somewhere under publish). Click the arrow and select your new theme that you just created.

    Now, since each page is different, what I do is just create a different template for each one. I just edit what text I want changed in my code, rename the template, and then upload it. With this, the format should stay the same, as long as you just change the text for each seperate template you make.

    Hope that makes sense, but if I'm understanding you correct, it should be a quick easy way to achieve what you're wanting.

    Let me know if you have any questions.
    {{ DiscussionBoard.errors[5613525].message }}
    • Profile picture of the author danb12
      Originally Posted by NMVTEric View Post

      I'm not 100% sure if this is the easiest way, but it might help.

      Open up notepad and copy and paste this at the top.

      <?php /* Template Name: template name here */ ?>

      Then, copy your entire page code, whether html or php, below that.

      Save that as a .php file.

      Upload that file into your wp-content/themes/ folder under the theme that you're using.

      Then, when you create a new page, you will see a field titled template (somewhere under publish). Click the arrow and select your new theme that you just created.

      Now, since each page is different, what I do is just create a different template for each one. I just edit what text I want changed in my code, rename the template, and then upload it. With this, the format should stay the same, as long as you just change the text for each seperate template you make.

      Hope that makes sense, but if I'm understanding you correct, it should be a quick easy way to achieve what you're wanting.

      Let me know if you have any questions.

      Thanks for the help

      im trying your way now.

      What should i name the php file?

      Anything?
      Signature
      UK Coupon Website PR1 making £300+ per month - QUICK SALE - CHEAP SALE - CONTACT ME
      {{ DiscussionBoard.errors[5613886].message }}
      • Profile picture of the author danb12
        ok

        so i added

        Code:
        <?php /* Template Name:template */ ?> 
        
        
        <b>Template test</b>
        Uploaded it to wp-content/themes/ my theme

        and tried adding a new page, but I don't see a field for me to select the template for me to use?
        Signature
        UK Coupon Website PR1 making £300+ per month - QUICK SALE - CHEAP SALE - CONTACT ME
        {{ DiscussionBoard.errors[5613953].message }}
        • Profile picture of the author Eric S
          Originally Posted by danb12 View Post

          ok

          so i added

          Code:
          <?php /* Template Name:template */ ?> 
           
           
          <b>Template test</b>

          Uploaded it to wp-content/themes/ my theme

          and tried adding a new page, but I don't see a field for the template
          Here's a screen shot of where it is on mine.

          {{ DiscussionBoard.errors[5614013].message }}
          • Profile picture of the author danb12
            Ohh i don't have anything like that!

            are you sure that's the only code you needed to set that up?
            Signature
            UK Coupon Website PR1 making £300+ per month - QUICK SALE - CHEAP SALE - CONTACT ME
            {{ DiscussionBoard.errors[5614089].message }}
            • Profile picture of the author danb12
              Originally Posted by danb12 View Post

              Ohh i don't have anything like that!

              are you sure that's the only code you needed to set that up?

              Noo. i have it!

              But when loading the page, I get just a white page with no theme and this:

              Code:
              require('wp-blog-header.php'); get_header(); get_sidebar();  Template test
              This is the code in the template.php file i created:

              Code:
              <?php /* Template Name:template */ ?> 
              
              require('wp-blog-header.php');
              get_header();
              get_sidebar();
              
              <b>Template test</b>
              Signature
              UK Coupon Website PR1 making £300+ per month - QUICK SALE - CHEAP SALE - CONTACT ME
              {{ DiscussionBoard.errors[5614106].message }}
  • Profile picture of the author Istvan Horvath
    You guys are both wrong in your approach!

    Although you can have custom Page templates... that will NOT solve the question in the OP.

    You should look into adding custom post types AND custom Write Post panel for them in the admin.
    Signature

    {{ DiscussionBoard.errors[5613631].message }}
  • Profile picture of the author Eric S
    It can be anything.

    Like I said, it's probably not the most efficient way, but it works for me. One thing I forgot to mention. If you want your full wordpress theme to show up on these pages, like header, footer, sidebar, widgets, etc. There is a code to call all these functions. you would include

    require('wp-blog-header.php');
    get_header();
    get_sidebar();

    within the php code at the top.
    {{ DiscussionBoard.errors[5613969].message }}
  • Profile picture of the author Istvan Horvath
    Just in case you guys missed this... it will NOT work with templates.

    If I understood it correctly, the OP needs to create many, many Pages that have the same fields (or something similar).

    With the very bad solution suggested by Eric the OP would need to create a Page template for every Page - WTF, that's even worse than typing the same stuff into each Page!

    No, templates is NOT the way to do it.
    You need a custom Write subpanel.
    Signature

    {{ DiscussionBoard.errors[5614158].message }}
    • Profile picture of the author danb12
      Originally Posted by Istvan Horvath View Post

      Just in case you guys missed this... it will NOT work with templates.

      If I understood it correctly, the OP needs to create many, many Pages that have the same fields (or something similar).

      With the very bad solution suggested by Eric the OP would need to create a Page template for every Page - WTF, that's even worse than typing the same stuff into each Page!

      No, templates is NOT the way to do it.
      You need a custom Write subpanel.

      No this is a great idea, simple and great!

      I have my pages all in html txt files so i could just copy and paste!
      Signature
      UK Coupon Website PR1 making £300+ per month - QUICK SALE - CHEAP SALE - CONTACT ME
      {{ DiscussionBoard.errors[5614189].message }}
      • Profile picture of the author Istvan Horvath
        Originally Posted by danb12 View Post


        I have my pages all in html txt files so i could just copy and paste!
        So... if you already have the formatted HTML code for all that stuff you were bored to type in... WHY didn't you just copy/paste the html code into the Page content (while turning off the wysiwyg Visual editor)? And you don't even need any Page template for that.

        You could have save us from going in circles...

        <rant> that's why you hate when people give only half of the info when asking questions...</rant>
        Signature

        {{ DiscussionBoard.errors[5614303].message }}
  • Profile picture of the author danb12
    GOT IT!!

    Code:
    <?php /* Template Name:template */ ?> 
    
    <?php get_template_part('content', 'before'); ?>
    
    <b>Template test</b>
    
    <?php get_template_part('content', 'after'); ?>
    Thanks so much for your help! been trying this for DAYS!!
    Signature
    UK Coupon Website PR1 making £300+ per month - QUICK SALE - CHEAP SALE - CONTACT ME
    {{ DiscussionBoard.errors[5614164].message }}
  • Profile picture of the author Eric S
    <?php
    /*
    Template Name: Cover Page
    */
    ?>

    <?php get_header(); ?>
    Here's my cover page!
    <?php get_footer(); ?>

    You need to put the code inside <?php ?> Try messing around with this code... and as you'll see, you can use the same format to call your sidebar.
    {{ DiscussionBoard.errors[5614202].message }}
  • Profile picture of the author Eric S
    Oh, just saw your post. Glad you figured it out. I don't know if it's the best idea or not, but I'm the same way, I just copy and paste my html underneath the .php and it takes a whole 2-3 minutes per page to set up.
    {{ DiscussionBoard.errors[5614219].message }}

Trending Topics