Board index   FAQ   Search  
Register  Login
Board index PHP Your Scripts

Basic Blog Help for Newbie Please!

This is where you share YOUR scripts with others

Moderators: macek, egami, gesf

Basic Blog Help for Newbie Please!

Postby bramble » Mon Apr 25, 2011 12:44 am

Hi There

I was wondering if anyone could help me with a bit of script. This is what I have at the moment:

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

<?php get_header(); ?>

<?php if (is_home()) { query_posts('showposts=1'); } ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>

<!-- BEGIN #photo -->
<h2 class="photo-title"><span><?php the_title(); ?></span></h2>
<div id="photo">
<div id="photo-inner">
<?php the_content(); ?>
<?php the_tags('<hr />TAGS: ', ', ', ''); ?>
</div>
</div>
<!-- END #photo -->

<!-- BEGIN photo meta -->
<div id="photo-meta">
<div id="photo-meta-inner">
<ul>
<li><?php the_time('F jS, Y') ?></li>
<li><?php the_category(', ') ?></li>
<?php $wp_query->is_single = false; ?>
<li><?php comments_popup_link('No comments', '1 comment', '% comments','Comments closed'); ?></li>
<li><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">#</a></li>
<?php edit_post_link(__('Edit'), '<li>', '</li>'); ?>
</ul>
</div>
</div>
<!-- END photo meta -->


<!-- BEGIN navigate -->
<div id="navigate">
<div id="navigate-inner" class="clearfix">
<?php $wp_query->is_single = true; ?>
<span class="previous"><?php previous_post( '%', 'Previous', '' ) ?></span>
<span class="next"><?php next_post( '%', 'Next', '' ) ?></span>
</div>
</div>
<!-- END navigate -->

<?php endwhile; ?>
<?php endif; ?>

<?php get_footer(); ?>

but the bold part dow not show up on the website ....

What I would like really is that a new post just drops in on top of the old post, and when we get to 10 posts they start to be archived from the bottom, but I have no idea how to go about it.

Any help would be greatly appreaciated as at the moment, I only seem to be able to have one post visible at a time.

Many Thanks
Bramble

p.s. I am a code idiot, please be gentle
bramble
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Apr 25, 2011 12:39 am

Re: Basic Blog Help for Newbie Please!

Postby johnj » Mon Apr 25, 2011 5:36 am

does the code show up in the page view source ?
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Basic Blog Help for Newbie Please!

Postby bramble » Tue Apr 26, 2011 12:20 am

The code shows up in the edit view but when i look at the page it doesn't show anything below the box with the post in it, the stuff about categories, previous and next is not there at all ...
bramble
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Apr 25, 2011 12:39 am

Re: Basic Blog Help for Newbie Please!

Postby johnj » Wed Apr 27, 2011 9:56 am

This is difficult to debug without the css files. What you can do is remove all the class and id from the divs and then try displaying the file.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to Your Scripts

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron