Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   Page Navigation and Comments not showing with Code (http://forum.bytesforall.com/showthread.php?t=5368)

sleizure Jan 17, 2010 09:45 PM

Page Navigation and Comments not showing with Code
 
Hello, I've gone against the grain, and have a static Homepage configured showing recent posts, and gallery photos. I have my Journal Link located at http://www.tiredofit.ca/journal/

I am loading Journal.php via the template function with the following code

PHP Code:

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

get_header(); ?>
    <?php // Displayed on MULTI post pages if activated at Theme Options -> Next/Previous Navigation:
    
bfa_next_previous_page_links('Top'); // To edit the output, see functions/bfa_next_previous_links.php ?>

<?php
//detect a set series of posts per page
$ppp get_option('posts_per_page');
 
// initial page fourteen posts
if (!is_paged()) {
    
$posts get_posts('numberposts=1&cat=-23&order=DESC&orderby=date');
// second page with offset
} elseif($paged == 2) {
    
$posts get_posts('offset=5');
// all alternative pages with settings from backend
} else {
    
$offset $ppp*($paged-2)+5;
    
$posts get_posts('offset='.$offset);
}
 
if(
$posts) :
    foreach (
$posts as $post) :
     
setup_postdata($post);
                
next_post_link();
     
?>

      <div>

<font size="4.2pt"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"> <?php the_title(); ?></a></font> &nbsp;&nbsp;&nbsp;   <font size="0.2pt" text-align="right"><?php the_date(); ?> <?php the_time(); ?>-  <?php the_author(); ?></font></p> 
 <?php the_content(); ?>

  </div>

 <?php endforeach;
 endif 
?></td>
 
 <?php // Displayed on MULTI post pages if activated at Theme Options -> Next/Previous Navigation:
    
bfa_next_previous_page_links('Bottom'); // To edit the output, see functions/bfa_next_previous_links.php ?>

            <?php // Load Comments template (on single post pages, and "Page" pages, if set on options page)
        
bfa_get_comments(); // To edit the output, see functions/bfa_post_parts.php ?>


 <?php get_footer(); ?>

Which works fine, showing the last post without issue, but does not show page navigation or the comments. I have just upgraded to 3.45 to see if I could get it working but it still doesn't. On a logistics / navigation end its a nightmare as my users are looking for the back and forth links. How would I add this back in, or am I just being overly complicated with trying to show my latest post?

lmilesw Jan 18, 2010 12:33 PM

The link to your site isn't working for me. And yes you may indeed be going about this in a more complicated than necessary manner. What exactly do you want to show up on your home page or journal page?

sleizure Jan 18, 2010 01:58 PM

Sorry - we had some hosting issues this morning.

I have my Wordpress Configuration to point to "Home" For the Front Page, and for the Posts page to point to "Dummy Page Do Not Delete" - That no one will ever visit. the reason why I do this, is if I set it to a Static Page such as "Journal" - It shows the contents of the home.php file as well.

I have my homepage functioning as per normal, but the Journal Link, I simply want it to show the latest post, with navigation arrows, and the comment form. At present it does not work.

Does this make a bit more sense?

lmilesw Jan 18, 2010 02:38 PM

I'm still not clear on why you can't set WordPress to a static home page and a static Journal page for blog posts. What items show up on the blog/journal page that you don't want. It should just display posts.

sleizure Jan 18, 2010 02:41 PM

Here is the contents of my home page: It's ugly and I have to hand edit the front of it. If I set the "posts" page to "Journal" it shows the home page again.

PHP Code:

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

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

<a class="flickr-image alignleft" rel="flickr-mgr" href="http://www.flickr.com/photos/40600878@N08/3926056351/"><img class="flickr-small" src="http://farm4.static.flickr.com/3476/3926056351_ecb5698bb6_s.jpg" alt="" /></a>

<BR>Hello! This is the website of a Canadian documenting his travels around the world while riding a bicycle. Within these pages you will also find equipment reviews of components, packing lists and other resources to aid other people wishing to embark on long term bicycle touring journeys. <BR> <P>
&nbsp;<br>
<CENTER><B>I'm currently planning <a href="http://www.tiredofit.ca/phase-3">Phase-3</a> taking me from Vancouver BC, Canada all the way to St. Johns Newfoundland, Canada! </B><P>

 <p style="text-align: center;"></p>
<CENTER>
<table style="width: 85%;" border="0">
<tbody>
<tr>
<td style="text-align: center; width: 380px;"><span style="text-decoration: underline;"><h3><A HREF="http://www.tiredofit.ca/stats/">Where am I?</A></h3></span></td>
<?php
global $post;
$latest_posts get_posts('numberposts=1');
foreach(
$latest_posts as $latest) {
echo 
'<td style="text-align: center; width: 380px;"><span style="text-decoration: underline;"><h3><a href="'.get_permalink($latest->ID).'">Latest Post</a></span></td></tr>';
}
?>
</tr>
<tr>
<td style="text-align: center; width: 380px;">
<CENTER><?php echo GeoMashup::map('height=240&width=340&zoom=10&add_overview_control=false&add_map_type_control=false&map_content=single'); ?></CENTER>
       
 </td>
<td style="text-align: left;">  <?php
 $postslist 
get_posts('numberposts=1&order=DESC&orderby=date');
 foreach (
$postslist as $post) : 
    
setup_postdata($post);
 
?> 
 <div>
<CENTER><font size="4.2pt"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"> <?php the_title(); ?></a></font> &nbsp;&nbsp;&nbsp;  <br> <font size="0.2pt" text-align="right"><?php the_date(); ?> <?php the_time(); ?> -  <?php the_author(); ?></font></p> </CENTER>
 <?php the_excerpt(); ?>
 <p style="text-align: right;"><a href="<?php the_permalink(); ?>" title="Click to read more">--more--</A></p>
 </div>
 <?php endforeach; ?></td>
</tr>
<tr>
<td style="text-align: center; width: 380px;"><span style="text-decoration: underline;"><h3><A HREF="http://www.tiredofit.ca/recentphotos/">Recent Images</A></h3></span></td>

<td style="text-align: center; width: 380px;"><span style="text-decoration: underline;"><h3><A HREF="http://www.tiredofit.ca/journal/">Recent Posts</A></h3></span></td>


<tr>
<td style="text-align: center;">
<CENTER><?php echo $falbum->show_recent(12,1,'s','');?></CENTER>
 
 </td>
 
<td style="text-align: left;">
     <ul>
    <?php query_posts('showposts=12'); ?>

    <?php while (have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a> - <?php the_date(); ?></li>

    <?php endwhile;?>
    </ul>
</td>
     
 </tr>

</tbody></table>

</CENTER>

<?php get_footer(); ?>


lmilesw Jan 18, 2010 02:53 PM

I'm not a coding/php guru so I'm not sure what to tell you. I would probably have just put a table on the home page and used shortcodes and/or code snippets to generate something similar to what you have.

Maybe someone else that knows php can jump into this thread.

sleizure Jan 18, 2010 03:55 PM

Thanks for trying :) I tried to do the shortcode thing but it failed miserably.


All times are GMT -6. The time now is 02:41 PM.

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