Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

[SOLVED] How to make custom template with exact format except header and menus


  #1  
Old Dec 14, 2009, 02:50 PM
Rashell's Avatar
Rashell
 
67 posts · May 2009
I was in the process of making a custom template for pages that consists of everything except menus. So I copied index.php and grabbed some info from the header.php (which I swapped for the dynamic header plugin) and wound up getting a page that shows the loop on top of the sidebars.

I just can't seem to figure out how to get everything to align like it would had all I changed was the top header area.

I'm using ATA 3.4.4

and this code...

PHP Code:
<?php
/*
Template Name: LP
*/
?> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<?php /* if index.php or another page template (copied from index.php) was not used
(i.e. by a plugin such as WPG2), the global $bfa_ata would be empty */
global $bfa_ata; if ($bfa_ata == "") include_once (TEMPLATEPATH '/functions/bfa_get_options.php'); ?>
<?php 
if ( $bfa_ata['css_external'] == "External" ) { ?>
<link rel="stylesheet" href="<?php echo $bfa_ata['get_option_home']; ?>/?bfa_ata_file=css" type="text/css" media="all" />
<?php ?>
<?php 
include (TEMPLATEPATH '/functions/bfa_meta_tags.php'); ?>
<?php 
if ($bfa_ata['favicon_file'] != "") { ?><link rel="shortcut icon" href="<?php echo $bfa_ata['template_directory']; ?>/images/favicon/<?php echo $bfa_ata['favicon_file']; ?>" /><?php ?>
<?php 
if ( is_single() OR is_page() ) { ?><link rel="canonical" href="<?php the_permalink(); ?>" /><?php ?>
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php     wp_enqueue_script'jquery' ); ?>
<?php 
if ( function_exists('wp_list_comments') AND is_singular() ) {     wp_enqueue_script'comment-reply' ); } ?>
<?php wp_head
(); ?>
<?php 
echo ($bfa_ata['html_inserts_header'] != "" apply_filters(widget_text$bfa_ata['html_inserts_header']) : ''); ?>
<?php 
if ($bfa_ata['pngfix_selectors'] != "") { ?>
<!--[if IE 6]>
<script type="text/javascript" src="<?php echo $bfa_ata['template_directory']; ?>/js/DD_roundies.js"></script>
<script type="text/javascript">DD_roundies.addRule('<?php echo $bfa_ata['pngfix_selectors']; ?>');</script>
<![endif]-->
<?php ?>
</head>

<body <?php body_class(); ?><?php echo ($bfa_ata['html_inserts_body_tag'] != "" ' ' apply_filters(widget_text$bfa_ata['html_inserts_body_tag']) : ''); ?>>
<?php echo ($bfa_ata['html_inserts_body_top'] != "" apply_filters(widget_text$bfa_ata['html_inserts_body_top']) : ''); ?>
<div id="wrapper">
<div id="container">
<table id="layout" border="0" cellspacing="0" cellpadding="0">
<colgroup>
<?php if ( $bfa_ata['left_col'] == "on" ) { ?><col class="colone" /><?php ?>
<?php 
if ( $bfa_ata['left_col2'] == "on" ) { ?><col class="colone-inner" /><?php ?>
<col class="coltwo" />
<?php if ( $bfa_ata['right_col2'] == "on" ) { ?><col class="colthree-inner" /><?php ?>
<?php 
if ( $bfa_ata['right_col'] == "on" ) { ?><col class="colthree" /><?php ?>
</colgroup> 
    <tr>

        <!-- Header -->
        <td id="header" colspan="<?php echo $bfa_ata['cols']; ?>">
<?php show_media_header(); ?>
                
        </td>
        <!-- / Header -->

    </tr>
<body>

<td id="middle">
<?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 /* This outputs the next/previous post or page navigation. 
    This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
    
bfa_center_content($bfa_ata['content_above_loop']); ?>

    <?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 /* This is the actual Wordpress LOOP. 
        The output can be edited at Atahualpa Theme Options -> Style & edit the Center column */
        
bfa_center_content($bfa_ata['content_inside_loop']); ?>


                        
    <?php /* END of the LOOP */
    
endwhile; ?>

    <?php /* This outputs the next/previous post or page navigation and the comment template.
    This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
    
bfa_center_content($bfa_ata['content_below_loop']); ?>

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

<?php /* This outputs the "Not Found" content, if neither posts, pages nor attachments are available for the requested page.
This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
bfa_center_content($bfa_ata['content_not_found']); ?>

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

</body>
<?php bfa_center_content($bfa_ata['center_content_bottom']); ?>

<?php get_footer(); ?>
Any suggestions are appreciated,

Rashell
  #2  
Old Dec 14, 2009, 03:12 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Well frst off you have two '<body' which is a no no.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Dec 14, 2009, 08:34 PM
Rashell's Avatar
Rashell
 
67 posts · May 2009
Figured out how to get all the sidebars & content to show across the width of the center "container'

I added the following between the <head></head>...

PHP Code:
<?php     /* get all options: */ include (TEMPLATEPATH '/functions/bfa_get_options.php');?>
But for some reason the 1st widget takes up the whole center and kicks the rest just outside of the fixed width I had set up.

Would I have to style a new CSS/template to get these to line up?

I removed the extra <body> tag thanks for that...
  #4  
Old Dec 14, 2009, 08:42 PM
Rashell's Avatar
Rashell
 
67 posts · May 2009
figured it out. copied and pasted, pasted and copied too many things. I had the left sidebar set up with a colspan it didn't need.
  #5  
Old Dec 14, 2009, 08:57 PM
Rashell's Avatar
Rashell
 
67 posts · May 2009
Here's the entire code that worked for me. The key reason I did this was to create a header that mimicked my site headers minus clickable links. The menu bar spacing is retained as it's part of the site design.

PHP Code:
<?php
/*
Template Name: "Add Your Own Custom Template Name Here"
*/
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>

<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<?php /* if index.php or another page template (copied from index.php) was not used
(i.e. by a plugin such as WPG2), the global $bfa_ata would be empty */
global $bfa_ata; if ($bfa_ata == "") include_once (TEMPLATEPATH '/functions/bfa_get_options.php'); ?>
<?php 
if ( $bfa_ata['css_external'] == "External" ) { ?>
<link rel="stylesheet" href="<?php echo $bfa_ata['get_option_home']; ?>/?bfa_ata_file=css" type="text/css" media="all" />
<?php ?>
<?php 
include (TEMPLATEPATH '/functions/bfa_meta_tags.php'); ?>
<?php     
/* get all options: */ include (TEMPLATEPATH '/functions/bfa_get_options.php');?>
<?php 
if ($bfa_ata['favicon_file'] != "") { ?><link rel="shortcut icon" href="<?php echo $bfa_ata['template_directory']; ?>/images/favicon/<?php echo $bfa_ata['favicon_file']; ?>" /><?php ?>
<?php 
if ( is_single() OR is_page() ) { ?><link rel="canonical" href="<?php the_permalink(); ?>" /><?php ?>
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php     wp_enqueue_script'jquery' ); ?>
<?php 
if ( function_exists('wp_list_comments') AND is_singular() ) {     wp_enqueue_script'comment-reply' ); } ?>
<?php wp_head
(); ?>
<?php 
echo ($bfa_ata['html_inserts_header'] != "" apply_filters(widget_text$bfa_ata['html_inserts_header']) : ''); ?>
<?php 
if ($bfa_ata['pngfix_selectors'] != "") { ?>
<!--[if IE 6]>
<script type="text/javascript" src="<?php echo $bfa_ata['template_directory']; ?>/js/DD_roundies.js"></script>
<script type="text/javascript">DD_roundies.addRule('<?php echo $bfa_ata['pngfix_selectors']; ?>');</script>
<![endif]-->

<?php ?>
</head>

<body <?php body_class(); ?><?php echo ($bfa_ata['html_inserts_body_tag'] != "" ' ' apply_filters(widget_text$bfa_ata['html_inserts_body_tag']) : ''); ?>>
<?php echo ($bfa_ata['html_inserts_body_top'] != "" apply_filters(widget_text$bfa_ata['html_inserts_body_top']) : ''); ?>

<div id="wrapper">
<div id="container">
<table id="layout" border="0" cellspacing="0" cellpadding="0">
<colgroup>
<?php if ( $bfa_ata['left_col'] == "on" ) { ?><col class="colone" /><?php ?>
<?php 
if ( $bfa_ata['left_col2'] == "on" ) { ?><col class="colone-inner" /><?php ?>
<col class="coltwo" />
<?php if ( $bfa_ata['right_col2'] == "on" ) { ?><col class="colthree-inner" /><?php ?>
<?php 
if ( $bfa_ata['right_col'] == "on" ) { ?><col class="colthree" /><?php ?>
</colgroup> 


    <tr>

        <!-- Header -->
        <td id="header" colspan="<?php echo $bfa_ata['cols']; ?>">
                       <?php show_media_header(); ?>
        </td>
        <!-- / Header -->

    </tr>

    <!-- Main Body -->    
    <tr id="bodyrow">

        <?php if ( $bfa_ata['left_col'] == "on" ) { ?>
        <!-- Left Sidebar -->
        <td id="left">

            <?php // Widgetize the Left Sidebar 
            
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Left Sidebar') ) : ?>
        
                    <div class="widget widget_categories"><div class="widget-title">
                    <h3><?php _e('Categories','atahualpa'); ?></h3>
                    </div>
                    <ul><?php wp_list_categories('show_count=1&title_li='); ?></ul>
                    </div>
                    
                    <div class="widget widget_archive"><div class="widget-title">
                    <h3><?php _e('Archives','atahualpa'); ?></h3>
                    </div>
                    <ul><?php wp_get_archives('type=monthly'); ?></ul>
                    </div>
                                    
            <?php endif; ?>

        </td>

        <!-- / Left Sidebar -->
        <?php ?>

        <?php if ( $bfa_ata['left_col2'] == "on" ) { ?>
        <!-- Left INNER Sidebar -->
        <td id="left-inner">

            <?php // Widgetize the Left Inner Sidebar 
            
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Left Inner Sidebar') ) : ?>
        
                    <!-- no default content for the LEFT INNER sidebar -->
                                    
            <?php endif; ?>

        </td>
        <!-- / Left INNER Sidebar -->
            <?php ?>

        <!-- Main Column -->
        <td id="middle">

<?php
 
//Code automatically inserted by Featurific for Wordpress plugin
 
if(is_home())                             //If we're generating the home page (remove this line to make Featurific appear on all pages)...
  
if(function_exists('insert_featurific')) //If the Featurific plugin is activated...
   
insert_featurific();                    //Insert the HTML code to embed Featurific
?>

<?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 /* This outputs the next/previous post or page navigation. 
    This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
    
bfa_center_content($bfa_ata['content_above_loop']); ?>

    <?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 /* This is the actual Wordpress LOOP. 
        The output can be edited at Atahualpa Theme Options -> Style & edit the Center column */
        
bfa_center_content($bfa_ata['content_inside_loop']); ?>


                        
    <?php /* END of the LOOP */
    
endwhile; ?>

    <?php /* This outputs the next/previous post or page navigation and the comment template.
    This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
    
bfa_center_content($bfa_ata['content_below_loop']); ?>

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

<?php /* This outputs the "Not Found" content, if neither posts, pages nor attachments are available for the requested page.
This can be edited at Atahualpa Theme Options -> Style & edit the Center column */
bfa_center_content($bfa_ata['content_not_found']); ?>

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

<?php bfa_center_content($bfa_ata['center_content_bottom']); ?>

<?php get_footer(); ?>

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help make my blog look like a custom designed site queenw Customization, Design, Programming... 1 Dec 17, 2009 01:19 AM
[SOLVED] How can I insert a picture in a custom page template? reradu Atahualpa 3 Wordpress theme 10 Oct 15, 2009 03:00 AM
[SOLVED] Format Date for Custom fields using %meta(fieldname)% grasshopper Post-Kicker, -Byline & -Footer 4 Aug 1, 2009 09:01 AM
Adding shortcode in custom template paulae Plugins & Atahualpa 1 May 21, 2009 05:20 PM
Creating custom post template paulae Atahualpa 3 Wordpress theme 3 Mar 18, 2009 11:36 AM


All times are GMT -6. The time now is 12:55 PM.


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