• mrjasmin

    (@mrjasmin)


    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

Viewing 9 replies - 1 through 9 (of 9 total)
  • taghaboy

    (@taghaboy)

    did you close the tag in the line 21?

    taghaboy

    (@taghaboy)

    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 ;   ?>

    Thread Starter mrjasmin

    (@mrjasmin)

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

    Thread Starter mrjasmin

    (@mrjasmin)

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

    taghaboy

    (@taghaboy)

    :p

    Thread Starter mrjasmin

    (@mrjasmin)

    Anyone ?

    Thread Starter mrjasmin

    (@mrjasmin)

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

    taghaboy

    (@taghaboy)

    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 🙂

    taghaboy

    (@taghaboy)

    what’s up Jasmin!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Desperate need of help with wordpress’ is closed to new replies.