Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

[SOLVED] Step by step for creating a page/post template in Atahualpa


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Feb 26, 2010, 03:51 PM
lmilesw's Avatar
lmilesw
 
10,082 posts · Jul 2009
Central New York State USA
I'm not a php guru and want to create page templates. I know that you can copy the index.php and I know the little snippet of code you put at the top but it's all the code that goes on the page I'm not sure about. For instance if I wanted to create a page template that had no sidebars I know I can do that by putting the id of the page I don't want sidebars on but how do I create a template that doesn't call them?

I really would like a simple rudimentary step by step as an example. I could use that to jump start my learning curve. Is there a more WYSIWYG way of creating the page template?
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #2  
Old Feb 26, 2010, 08:59 PM
paulae's Avatar
paulae
 
1,332 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
If all you want to do is get rid of sidebars for a particular page, not a post, you can of course do it with the theme options/style and configure sidebars. You can do that for whole categories of posts, too, but not individual posts. Maybe Flynn can add that option at some point, by post ID.

I've made some custom post templates to ADD information, not to remove something. It would seem to me you need to interfere with the call for sidebars in the functions.php file, but I'm not sure how to do it.

Once you have your new template, you need to make it show up in the editing area. I found Single Post Template plugin, and there is info with it about how to put a special title at the top of the template file to distinguish it from the regular index.php, from which it is constructed.
  #3  
Old Feb 27, 2010, 01:45 PM
lmilesw's Avatar
lmilesw
 
10,082 posts · Jul 2009
Central New York State USA
The Single Post Template plugin is one I wanted to play with. I have fiddled around with page templates and understand the idea of creating one but mostly what I find on creating templates is to "put this code at the top of the page" and then it say to add the code I want for the rest. That is where I don't know what to do. I want a tutorial of sorts on adding "the code I want" to the rest fo the page or post.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #4  
Old Feb 27, 2010, 01:53 PM
paulae's Avatar
paulae
 
1,332 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
Shall I show you one of the post templates I made? This is for our Career Doctor column. The columnist wanted her photo and a link to a contact form at the bottom of all of her posts. I used index.php, put the specialized Single Post template name at the top (and named the file my-career-doctor-template.php), and then added the other orange text to the file. I put it in the theme folder, and now when she does a new post, she can choose from the drop-down template menu to find this one and apply it.

You can see it in action. Go here http://www.larchmontgazette.com/category/careerdoctor/ and click on one of the posts. To get the photo at the top of the category page, I used a new widget area.

Code:
<?php
/*
Single Post Template: my-career-doctor-template
Description: This part is optional, but helpful for describing the Post Template
*/
?>

<?php /* get all options: */
include (TEMPLATEPATH . '/functions/bfa_get_options.php');
get_header(); ?> 

<?php /* If there are any posts: */
if (have_posts()) : $bfa_ata['postcount'] == 0; /* Postcount needed for option "XX first posts full posts, rest excerpts" */ ?>

<?php /* For MULTI post pages if activated at ATO -> Next/Previous Navigation: */
bfa_next_previous_page_links('Top'); ?>

<?php /* For the plugin Page2Cat http://wordpress.org/extend/plugins/page2cat/ */
if( is_category() AND function_exists('page2cat_output')) { page2cat_output($cat); } ?>

<?php /* The LOOP starts here. Do this for all posts: */
while (have_posts()) : the_post(); $bfa_ata['postcount']++; ?>

<?php /* Add Odd or Even post class so post containers can get alternating CSS style (optional) */
$odd_or_even = (($bfa_ata['postcount'] % 2) ? 'odd-post' : 'even-post' ); ?> 

<?php /* For SINGLE post pages if activated at ATO -> Next/Previous Navigation: */
bfa_next_previous_post_links('Top'); ?>

<?php /* Post Container starts here */
if ( function_exists('post_class') ) { ?>
<div <?php if ( is_page() ) { post_class('post'); } else { post_class("$odd_or_even"); } ?> id="post-<?php the_ID(); ?>">
<?php } else { ?>
<div class="<?php echo ( is_page() ? 'page ' : '' ) . $odd_or_even . ' post" id="post-'; the_ID(); ?>">
<?php } ?>

<?php bfa_post_kicker('<div class="post-kicker">','</div>'); ?>

<?php bfa_post_headline('<div class="post-headline">','</div>'); ?>

<?php bfa_post_byline('<div class="post-byline">','</div>'); ?>

<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>

<?php bfa_post_pagination('<p class="post-pagination"><strong>'.__('Pages:','atahualpa').'</strong>','</p>'); ?>

<?php bfa_post_footer('<div class="post-footer">','</div>'); ?>

</div><!-- / Post -->
                        
<?php /* END of the LOOP */
endwhile; ?>

<?php /* Displayed on SINGLE post pages if activated at ATO -> Next/Previous Navigation: */
bfa_next_previous_post_links('Middle'); ?>

<hr align=center>

<center><img src="http://www.larchmontgazette.com/wp27/wp-content/uploads/2009/12/plumezheader2.jpg"></center>
<p>Please <a href="http://larchmontgazette.com/careerdoctor/ask-the-career-doctor-a-question">click here</a> to ask the Career Doctor a question.</p>

<?php /* Load Comments template (on single post pages, and static pages, if set on options page): */
bfa_get_comments(); ?>

<?php /* Displayed on SINGLE post pages if activated at ATO -> Next/Previous Navigation: */
bfa_next_previous_post_links('Bottom'); ?>
        
<?php /* Archives Pages. Displayed on a specific static page, if configured at ATO -> Archives Pages: */
bfa_archives_page('<div class="archives-page">','</div>'); ?>
            
<?php /* Displayed on MULTI post pages if activated at ATO -> Next/Previous Navigation: */
bfa_next_previous_page_links('Bottom'); ?>

<?php /* END of: If there are any posts */
else : /* If there are no posts: */ ?>

<h2><?php _e('Not Found','atahualpa'); ?></h2>
<p><?php _e("Sorry, but you are looking for something that isn't here.","atahualpa"); ?></p>

<?php endif; /* END of: If there are no posts */ ?>

<?php get_footer(); ?>
  #5  
Old Feb 28, 2010, 06:31 AM
lmilesw's Avatar
lmilesw
 
10,082 posts · Jul 2009
Central New York State USA
Thanks Paula... That gives me a starting point. How did you determine where to put your added code?
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #6  
Old Feb 28, 2010, 06:39 AM
paulae's Avatar
paulae
 
1,332 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
I knew I wanted it above the comments box, so I stuck it there.
  #7  
Old Feb 28, 2010, 06:53 AM
lmilesw's Avatar
lmilesw
 
10,082 posts · Jul 2009
Central New York State USA
That's all I needed to know. You've been a big help Paula.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
BUGFIX - 3.4.3/3.4.4 - STEP-BY-STEP instructions for removing 'bad' NEW WIDGET AREA's juggledad Old Version fixes and change logs 3 Nov 1, 2009 01:03 PM
I need step by step instructions on how to change a background image. FollowAshley.com Header configuration & styling 4 Aug 29, 2009 09:06 PM
How to turn off Atahualpa Post Options, interferes (kind of) with Post Template maccool Post-Kicker, -Byline & -Footer 1 Aug 13, 2009 09:00 AM
Creating custom post template paulae Atahualpa 3 Wordpress theme 3 Mar 18, 2009 10:36 AM


All times are GMT -6. The time now is 09:37 PM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.