Problem creating a single page


Author Message
fullenchilada

Posted: 7/9/2009
Quote message 

Hey you guys,

creating a wordpress theme with artisteer is very easy. creating a single page, however, is a little more tricky.

i thought about simply saving the layout that i already have under a new name and then changing the 3 column (content plus two sidebars) layout to a 2 column layout. when i copy the newly created single.php or page.php in my theme directory, i get to learn that nothing has really changed. one of the sidebars is gone, yes, but that didn't really do anything to the overall width. i figured the reason must be the css style.

so i fired up my firefox 3.5 and tried to find out which css style is being used making use of the firefox extension firebug.

i really do love the program but it just creates a lot of redundant code. especially when you look at the css file. seems like there are hundreds of styles and finding one specific one is like looking for the needle in a haystack.

here is my single.php:

<?php get_header(); ?>
<div class="art-contentLayout">
<div class="art-content">

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
$prev_link = get_previous_post_link('&laquo; %link');
$next_link = get_next_post_link('%link &raquo;');
?>
<?php if ($prev_link || $next_link): ?>
<div class="art-Post">
<div class="art-Post-tl"></div>
<div class="art-Post-tr"></div>
<div class="art-Post-bl"></div>
<div class="art-Post-br"></div>
<div class="art-Post-tc"></div>
<div class="art-Post-bc"></div>
<div class="art-Post-cl"></div>
<div class="art-Post-cr"></div>
<div class="art-Post-cc"></div>
<div class="art-Post-body">
<div class="art-Post-inner art-article">

<div class="art-PostContent">

<div class="navigation">
<div class="alignleft"><?php echo $prev_link; ?></div>
<div class="alignright"><?php echo $next_link; ?></div>
</div>

</div>
<div class="cleared"></div>


</div>

</div>
</div>

<?php endif; ?>
<div class="art-Post">
<div class="art-Post-tl"></div>
<div class="art-Post-tr"></div>
<div class="art-Post-bl"></div>
<div class="art-Post-br"></div>
<div class="art-Post-tc"></div>
<div class="art-Post-bc"></div>
<div class="art-Post-cl"></div>
<div class="art-Post-cr"></div>
<div class="art-Post-cc"></div>
<div class="art-Post-body">
<div class="art-Post-inner art-article">
<h2 class="art-PostHeaderIcon-wrapper">
<span class="art-PostHeader"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">
<?php the_title(); ?>
</a></span>
</h2>
<?php $icons = array(); ?>
<?php if (!is_page()): ?><?php ob_start(); ?><?php the_time(__('F jS, Y', 'kubrick')) ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page()): ?><?php ob_start(); ?><?php _e('Author', 'kubrick'); ?>: <a href="#" title="<?php _e('Author', 'kubrick'); ?>"><?php the_author() ?></a>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
<div class="art-PostHeaderIcons art-metadata-icons">
<?php echo implode(' | ', $icons); ?>

</div>
<?php endif; ?>
<div class="art-PostContent">
<?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry &raquo;', 'kubrick')); ?>

</div>
<div class="cleared"></div>
<?php ob_start(); ?>
<?php $icons = array(); ?>
<?php if (!is_page() && get_the_tags()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostTagIcon.png" width="24" height="24" alt="" />
<?php the_tags(__('Tags:', 'kubrick') . ' ', ', ', ' '); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && !is_single()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostCommentsIcon.png" width="24" height="24" alt="" />
<?php comments_popup_link(__('No Comments &#187;', 'kubrick'), __('1 Comment &#187;', 'kubrick'), __('% Comments &#187;', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
<div class="art-PostFooterIcons art-metadata-icons">
<?php echo implode(' | ', $icons); ?>

</div>
<?php endif; ?>
<?php $metadataContent = ob_get_clean(); ?>
<?php if (trim($metadataContent) != ''): ?>
<div class="art-PostMetadataFooter">
<?php echo $metadataContent; ?>

</div>
<?php endif; ?>

</div>

</div>
</div>

<?php comments_template(); ?>
<?php endwhile; ?>
<?php else: ?>
<h2 class="center"><?php _e('Sorry, no posts matched your criteria.', 'kubrick'); ?></h2>
<?php endif; ?>

</div>
<?php include (TEMPLATEPATH . '/sidebar1.php'); ?><?php include (TEMPLATEPATH . '/sidebar2.php'); ?>
</div>
<div class="cleared"></div>

<?php get_footer(); ?>

if someone could point me in the right direction as to which specific css style i have to change, i d be more than thankful.

 
Garry

Posted: 7/9/2009
Quote message 

You can create a new page template by adding following code at top of your page.php:

<?php
/*
Template Name: new template
*/
?>

Now you can assign this template to any page through your wordpress admin
 
fullenchilada

Posted: 7/10/2009
Quote message 

thanx for the quick answer garry.

clicking on one of the posts on the homepage is gonna directly take me to single.php, right? this page gives me the header of the post plus the entire article and stuff like tags, comments and so on.

my problem is that on the single page i still have the regular template. my content block plus the two sidebars on the left.

artisteer is using way too many css styles for my taste so it is kinda way for me personally to target one specific style that tells the content block to have a width of XXX and the sidebars to have the widths of XXX.

if i don't adjust the single.php, my content will be jammed up to the left side.

i know that single.php is using the same stylesheet as the index.php which is kinda the problem.

if i understand you correctly then, i m simply supposed to add

<?php
/*
Template Name: site_single
*/
?>

at the very beginnning of single.php and then probably upload the other theme (the version with one content block and one sidebar) to my server. is that correct?


 
fullenchilada

Posted: 7/10/2009
Quote message 

Ok i was so brave as to jump into the CSS styles a little bit.

If you have a three column layout like i do, you most probably have the three following styles:

Content Block: (.art-content)
Sidebar1: (.art-sidebar1)
Sidebar2: (.art-sidebar2)

All three blocks are surrounded by (.art-contentLayout)

If you dig through the CSS stylesheet, you ll come across the following style:

.art-contentLayout .art-content
{
position: relative;
margin: 0;
padding: 0;
border: 0;
float: left;
overflow: hidden;
width: 441px;
}

This pretty much told my content block to only have a width of 441px. I copied the style and gave it a new name:

.art-contentLayout .art-content2
{
position: relative;
margin: 0;
padding: 0;
border: 0;
float: left;
overflow: hidden;
width: 679px;
}

I simply added a 2 as i was too lazy to come up with another name or simply because I have only had one cup of coffee :-).

Since I m gonna take sidebar 1 away, I simply added the width for that one (238px) to the width of the content block (441px) which left me with an overall width of 679px.

Then I opened up the single.php. At the beginning where it says something like this:

<?php get_header(); ?>
<div class="art-contentLayout">
<div class="art-content">

I changed the <div class="art-content"> to <div class="art-content2">. Further down below I removed sidebar 1:

</div>
<?php include (TEMPLATEPATH . '/sidebar1.php'); ?><?php include (TEMPLATEPATH . '/sidebar2.php'); ?>
</div>
<div class="cleared"></div>

So I m left with the following:

</div>
<?php include (TEMPLATEPATH . '/sidebar2.php'); ?>
</div>
<div class="cleared"></div>

I saved everything and uploaded it to my server. You might wanna figure out first which sidebar you wanna keep before you delete it. I used the firefox extension firebug to tell me which sidebar holds which kind of information.

I also did the same stuff to my page.php. I already created a couple of artisteer themes and all seem to be making use of the same style sheets so the chances are good you are stuck with the ones I have mentioned above.


 
Garry

Posted: 7/10/2009
Quote message 

I mean you should copy all code from page.php create a new file name it any of your choice, add upper code on top of it, upload that file into your theme folder and your new template will be available to you to choose from a drop down list when you add new page or edit existing page.

You can change this template's structure to your needs, may be you can delete sidebars add a new sidebar etc. etc.
 
Rosemary

Posted: 7/12/2009
Quote message 

Garry:
Quote :
your new template will be available to you to choose from a drop down list when you add new page or edit existing page.


Hi Garry,
I created new page2.php and single2.php files, more or less following fullenchilada's instructions. Then I ftp'd them to my theme folder.

When I add a page, I don't see a drop-down list anywhere. Am I missing a step?

Thanks,
Rosemary
 
Garry

Posted: 7/12/2009
Quote message 

You'll see a drop down list of available page templates on your left hand side while adding a new page or editing an editing an existing page on your wordpress admin
 
atul

Posted: 8/2/2009
Quote message 

Hi Fullenchilada

Me a newbie here and got a theme which can be seen on http://natural-remedies-for-thyroid.com. Paid for it but the work was incomplete and not to my requirement.
On the left i can see SEARCH,CATEGORIES,ARCHIVES AND LINKS.Since i have reviews sites i do not want any of the above .So how do i go modifying the above to remove them.
Require desperate help from you
AND PLEASE HELP ME AND GUIDE .Since me a newbie may find it difficult but will try
can mail me also at atultanna88@gmail.com

Quote fullenchilada:

Hey you guys,

creating a wordpress theme with artisteer is very easy. creating a single page, however, is a little more tricky.

i thought about simply saving the layout that i already have under a new name and then changing the 3 column (content plus two sidebars) layout to a 2 column layout. when i copy the newly created single.php or page.php in my theme directory, i get to learn that nothing has really changed. one of the sidebars is gone, yes, but that didn't really do anything to the overall width. i figured the reason must be the css style.

so i fired up my firefox 3.5 and tried to find out which css style is being used making use of the firefox extension firebug.

i really do love the program but it just creates a lot of redundant code. especially when you look at the css file. seems like there are hundreds of styles and finding one specific one is like looking for the needle in a haystack.

here is my single.php:

<?php get_header(); ?>
<div class="art-contentLayout">
<div class="art-content">

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php
$prev_link = get_previous_post_link('&laquo; %link');
$next_link = get_next_post_link('%link &raquo;');
?>
<?php if ($prev_link || $next_link): ?>
<div class="art-Post">
<div class="art-Post-tl"></div>
<div class="art-Post-tr"></div>
<div class="art-Post-bl"></div>
<div class="art-Post-br"></div>
<div class="art-Post-tc"></div>
<div class="art-Post-bc"></div>
<div class="art-Post-cl"></div>
<div class="art-Post-cr"></div>
<div class="art-Post-cc"></div>
<div class="art-Post-body">
<div class="art-Post-inner art-article">

<div class="art-PostContent">

<div class="navigation">
<div class="alignleft"><?php echo $prev_link; ?></div>
<div class="alignright"><?php echo $next_link; ?></div>
</div>

</div>
<div class="cleared"></div>


</div>

</div>
</div>

<?php endif; ?>
<div class="art-Post">
<div class="art-Post-tl"></div>
<div class="art-Post-tr"></div>
<div class="art-Post-bl"></div>
<div class="art-Post-br"></div>
<div class="art-Post-tc"></div>
<div class="art-Post-bc"></div>
<div class="art-Post-cl"></div>
<div class="art-Post-cr"></div>
<div class="art-Post-cc"></div>
<div class="art-Post-body">
<div class="art-Post-inner art-article">
<h2 class="art-PostHeaderIcon-wrapper">
<span class="art-PostHeader"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">
<?php the_title(); ?>
</a></span>
</h2>
<?php $icons = array(); ?>
<?php if (!is_page()): ?><?php ob_start(); ?><?php the_time(__('F jS, Y', 'kubrick')) ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page()): ?><?php ob_start(); ?><?php _e('Author', 'kubrick'); ?>: <a href="#" title="<?php _e('Author', 'kubrick'); ?>"><?php the_author() ?></a>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
<div class="art-PostHeaderIcons art-metadata-icons">
<?php echo implode(' | ', $icons); ?>

</div>
<?php endif; ?>
<div class="art-PostContent">
<?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry &raquo;', 'kubrick')); ?>

</div>
<div class="cleared"></div>
<?php ob_start(); ?>
<?php $icons = array(); ?>
<?php if (!is_page() && get_the_tags()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostTagIcon.png" width="24" height="24" alt="" />
<?php the_tags(__('Tags:', 'kubrick') . ' ', ', ', ' '); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (!is_page() && !is_single()): ?><?php ob_start(); ?><img src="<?php bloginfo('template_url'); ?>/images/PostCommentsIcon.png" width="24" height="24" alt="" />
<?php comments_popup_link(__('No Comments &#187;', 'kubrick'), __('1 Comment &#187;', 'kubrick'), __('% Comments &#187;', 'kubrick'), '', __('Comments Closed', 'kubrick') ); ?>
<?php $icons[] = ob_get_clean(); ?><?php endif; ?><?php if (0 != count($icons)): ?>
<div class="art-PostFooterIcons art-metadata-icons">
<?php echo implode(' | ', $icons); ?>

</div>
<?php endif; ?>
<?php $metadataContent = ob_get_clean(); ?>
<?php if (trim($metadataContent) != ''): ?>
<div class="art-PostMetadataFooter">
<?php echo $metadataContent; ?>

</div>
<?php endif; ?>

</div>

</div>
</div>

<?php comments_template(); ?>
<?php endwhile; ?>
<?php else: ?>
<h2 class="center"><?php _e('Sorry, no posts matched your criteria.', 'kubrick'); ?></h2>
<?php endif; ?>

</div>
<?php include (TEMPLATEPATH . '/sidebar1.php'); ?><?php include (TEMPLATEPATH . '/sidebar2.php'); ?>
</div>
<div class="cleared"></div>

<?php get_footer(); ?>

if someone could point me in the right direction as to which specific css style i have to change, i d be more than thankful.



 
Garry

Posted: 8/2/2009
Quote message 

@ atul

Just go to appearance-> widgets on your Wordpress admin after installing that theme and add just one widget of your choice to that sidebar and your SEARCH,CATEGORIES,ARCHIVES AND LINKS will go away.

Otherwise you need to remove code associated to SEARCH, CATEGORIES, ARCHIVES AND LINKS etc. from your sidebar