Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
Wordpress - petja (loop) na pagesima

 
Post new topic   Reply to topic    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
Nemesis



Joined: 01 Oct 2005
Posts: 732

PostPosted: 07.07.2011 19:37    Post subject: Wordpress - petja (loop) na pagesima Add user to your forum ignore list Reply with quote

Imam problem kojeg trebam poprilično hitno riješiti. Naime, trebao bi nekako staviti WP loop na custom page template. Petlja koju sam složio je ova:

Code:
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<div class="post">
   <div class="post_header">
      <a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
   </div>
   <div class="post_entry">
      <?php the_content(); ?>
   </div>
</div>
<?php endwhile; ?>
<?php endif; ?>


... ta petlja radi na index.php, ali ne i na tom custom templateu. Sad mene zanimaju dvije stvari. Prva je kako natjerati tu petlju da radi na custom templateu. A drugo pitanje je kako je poštimati da pokazuje samo jednu kategoriju (npr. ID=2)

E sad, ja sam pokušao googlati rješenje i svaki put naletim na nešto što radi polovično. Tj. pokazuje mi naslove ali ne i content...

Hvala Smile

_________________
Webastično.com | Last.fm | Twitter
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger Twitter profile
ante



Joined: 09 Oct 2003
Posts: 255
Location: st

PostPosted: 07.07.2011 21:18    Post subject: Add user to your forum ignore list Reply with quote

Code:
<?php query_posts('category_name=novosti'); ?>
<?php while (have_posts()) : the_post(); ?>
        <li>
                <a href="<?php the_permalink(); ?>">
                  <?php the_title(); ?>
               </a>
        </li>
 <?php endwhile; ?>


Probaj s ovim, mislim da bi trebalo raditi.
Back to top
View user's profile Send private message
ante



Joined: 09 Oct 2003
Posts: 255
Location: st

PostPosted: 07.07.2011 21:20    Post subject: Add user to your forum ignore list Reply with quote

Logično, query može biti i

Code:
<?php query_posts('category_id=2'); ?>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group