Wordpress Problem - Can Someone Help?

Status
Not open for further replies.
Hi everyone. I found a theme for my travel related Wordpress sites that I really like but I have a problem with it that hopefully someone will be able to help me with.

The main page and single post pages all look fine, but when you go to archives or categories, only a single post is displayed and the sidebar down the right with my ads and adsense on doesn't display hardly at all.

Has anyone got any ideas why this may be?

One of the sites you can see this on is Dubai Visits

Thanks
 


From viewing the source, its cutting off right in the middle a <li>(list item)

Seems like it may be a problem with the PHP side of it, maybe something is being parsed incorrectly, dunno without seeing the complete source file..
 
Thanks for taking a look. Which file do you think it would be? I'm assuming the sidebar.php file is ok because it displays ok on the main page and on the single posts.

Would you be willing to take a look if I could send you the file?

Thanks again

I don't know how much you know about PHP but does your template have an archive.php file with it?, if not thats ok but some templates do come with an archive.php file if yours does then the problem lies inside of that file somewhere, but if you can't get it to work send me the template or something and I'll fix it up for ya.
 
I'm afraid I don't know a lot about PHP at all. I have just looked through the Wordpress theme editor and there are two archives.php files listed. However, looking in the directory, there is an archives.php file which has about 21 lines of code and an archive.php file which has considerably more.

I don't even know which one might be causing the problem
 
I'm afraid I don't know a lot about PHP at all. I have just looked through the Wordpress theme editor and there are two archives.php files listed. However, looking in the directory, there is an archives.php file which has about 21 lines of code and an archive.php file which has considerably more.

I don't even know which one might be causing the problem

Ok thats actually good news, beacuse now we know what kind of template your dealing with your archive.php file should contain the code similar to the following.

Code:
<?php get_header(); ?>
        
    <div id="content_box">

        <?php get_sidebar(); ?>

        <div id="content" class="posts">
    
        <?php if (have_posts()) : ?>

            <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    
            <?php /* If this is a category archive */ if (is_category()) { ?>                
            <h3 class="archive_head">Entries Tagged as '<?php echo single_cat_title(); ?>'</h3>
            
            <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
            <h3 class="archive_head">Entries from <?php the_time('F Y'); ?></h3>
            
            <?php /* If this is a search */ } elseif (is_search()) { ?>
            <h3 class="archive_head">Search Results</h3>

            <?php } ?>

            <?php while (have_posts()) : the_post(); ?>
            <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
            
            <h4 class="meta">
                <img src="<?php echo get_template_directory_uri() ?>/images/icon_comment.gif" alt="Comments" />  
                <?php comments_popup_link('0', '1', '%'); ?>   
                
                <img src="<?php echo get_template_directory_uri() ?>/images/icon_datearr.gif" alt="Date Arrow" /> 
                <?php the_time('F j, Y') ?> at <?php the_time('g:ia') ?>   
                
                <img src="<?php echo get_template_directory_uri() ?>/images/icon_user.gif" alt="User" /> 
                by <?php the_author() ?>
            </h4>
            
            <div class="entry">
                <?php the_excerpt() ?>
            </div>    
            <p class="tagged"><img src="<?php echo get_template_directory_uri() ?>/images/icon_tag.gif" alt="Tagged" />   <?php the_category(' · ') ?><span><img src="<?php echo get_template_directory_uri() ?>/images/icon_comment.gif" alt="Comments" />  <?php comments_popup_link('Add Your Comment', 'Add Your Comment', 'Add Your Comment'); ?></span></p>
            
            <?php endwhile; ?>
            
            <?php include (TEMPLATEPATH . '/navigation.php'); ?>

        <?php else : ?>
        
            <h2 class="page_header">Nothing Found!</h2>
            <p>Try giving it another shot.</p>
            <div class="entry">
                <?php include (TEMPLATEPATH . '/searchform.php'); ?>
            </div>
            
        <?php endif; ?>
            
        </div>
            
    </div>
        
<?php get_footer(); ?>

and your archives.php file should be similar to this bit of code

Code:
<?php
/*
Template Name: Archives
*/
?>

<?php get_header(); ?>
        
    <div id="content_box">

        <?php get_sidebar(); ?>

        <div id="content" class="posts page">
        
            <h2>Browse the Archives</h2>
            <div class="entry">
                <h3 class="top">by month:</h3>
                <ul>
                    <?php wp_get_archives('type=monthly'); ?>
                </ul>
                <h3>by Category:</h3>
                <ul>
                    <?php list_cats(); ?>
                </ul>
            </div>

        </div>    
        
    </div>
        
<?php get_footer(); ?>

Now cross check your code with this code and see if you can find the error........if this is completely fucking you up then upload the theme somewhere I can download it from and PM me the location and I'll fix your problem.
 
Ok well its going on 3AM here so I'm taking off to bed if you cannot figure it out I'll check back in the morning to help out some more.
 
Ok, I've had a play with the code and the main thing I can see that is different is that the get_sidebar function call is right at the bottom of the code, whereas in your example, it's right near the top.

I've tried moving that line around and although I can get the sidebar to display, I can't get it in the right place. The rest of the code looks different and it is starting to look complicated. I don't want to screw it up completely.

Thanks for your help so far. If you have time to take a look at the theme, you can download it using the 'salmon' link that I have left intact at the bottom of the Dubai Visits site.

By the way, I have posted a comment about this on Justin's blog but the comment is still awaiting moderation.
 
I downloaded your theme(nice look by the way!) and here is the error my computer is showing me:

Fatal error
:Call to undefined function akst_share_link() in /var/www/wordpress/wp-content/themes/salmon/archive.php on line 43

I took out this line of code in the archive.php file:
<li><?php akst_share_link(); ?></li>

Now, everything is beautiful. Again, beautiful theme.



 
  • Like
Reactions: Aequitas
Fatal error: Call to undefined function smartArchives() in /var/www/wordpress/wp-content/themes/salmon/archive.php on line 68

This is the evil line:
smartArchives();

In the archive.php file, you are making a call to smartArchives. Take it out and you don't get the problem, BUT you might be using it for something? More than likely you have a plugin that is not activated or uploaded.


 
  • Like
Reactions: Ferraristi
I downloaded your theme(nice look by the way!) and here is the error my computer is showing me:

Fatal error
:Call to undefined function akst_share_link() in /var/www/wordpress/wp-content/themes/salmon/archive.php on line 43

I took out this line of code in the archive.php file:
<li><?php akst_share_link(); ?></li>

Now, everything is beautiful. Again, beautiful theme.


Thanks for finishing this up it was so late last night I was falling asleep haha.
 
Status
Not open for further replies.