WordPress.org

Ready to get started?Download WordPress

Forums

Desperate need of help with wordpress (10 posts)

  1. mrjasmin
    Member
    Posted 5 years ago #

    Hi! I´m having a little problem with my wordpress theme. I want to use query_posts on my theme, but when I add query_posts before the loop, than the page gets all white and everuthing on the page disappears. Everything else works just fine on the theme before i add the query_posts.

    How do i solve this problem ?

    Here is my code :

    http://pastie.org/441664

  2. taghaboy
    Member
    Posted 5 years ago #

    did you close the tag in the line 21?

  3. taghaboy
    Member
    Posted 5 years ago #

    OK, try this :

    <?php query_posts('category_name=Portfolio'); while (have_posts()) : the_post(); ?>
    
    <?php if(have_posts()) : ?>
    
    	<div class='post_snippet'>
    
    	<img src="<?php echo get_post_meta($post->ID, "Post Thumbnail", true);?>" class="postthumbnail"/>  
    
    	<h2><a href="<?php the_permalink(); ?>" title="Permanent link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
        <div class="posted"><b>Posted in</b> <?php the_category(’, ‘); ?> <?php the_date(); ?></div>
    	<div class="post"><?php the_excerpt(); ?></div>
    
    	<div class="comments"><?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></div>
    	</div>
    	<?php endwhile; ?>
    	<?php if(function_exists('wp_paginator')) { wp_paginator(); } ?>
        <?php else:     ?>
    	<h2> Could not find any blogpost </h2>
    	<? endelse
    	<?php endif ;   ?>
  4. mrjasmin
    Member
    Posted 5 years ago #

    taghaboy: still not working :S I really need to fix this problem..

  5. mrjasmin
    Member
    Posted 5 years ago #

    Anyone ? I will pay the one who helps me solve the problem.

  6. taghaboy
    Member
    Posted 5 years ago #

    :p

  7. mrjasmin
    Member
    Posted 5 years ago #

    Anyone ?

  8. mrjasmin
    Member
    Posted 5 years ago #

    Come on guys, i will pay 10 $ to the person who helps me.

  9. taghaboy
    Member
    Posted 5 years ago #

    Hi, try this one :

    <?php if (have_posts()) : ?>
    <?php query_posts('category_name=Portfolio'); ?><!-- Only portfolio postes, to ctrl the postes : &amp;showposts=1-->
    <?php while (have_posts()) : the_post(); ?>
    	<div class="post_snippet" id="post-<?php the_ID(); ?>"><!-- add the post id, useful for anchor...-->
    		<img src="<?php echo get_post_meta($post->ID, "Post Thumbnail", true);?>" class="postthumbnail"/>
    		<h2>
    			<a href="<?php the_permalink(); ?>" title="Permanent link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
    		</h2>
    			<div class="posted">
    				<b>Posted in</b> <?php the_category(’, ‘); ?> <?php the_date(); ?>
    			</div>
    			<div class="post"">
    				<?php the_excerpt(); ?>
    			</div>
    			<div class="comments">
    				<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
    			</div>
    	</div>
    <?php endwhile; ?>
    <?php if(function_exists('wp_paginator')) { wp_paginator(); } ?>
    <?php else : ?>
    	<h2> Could not find any blogpost </h2>
    <?php endif; ?>

    If it work, donat 10$ to wordpress.org :)

  10. taghaboy
    Member
    Posted 5 years ago #

    what's up Jasmin!

Topic Closed

This topic has been closed to new replies.

About this Topic