tutoriale photoshop, brushes, patterns, gradient
Site afiliat proiectului Webmaster Forums
  ”Tutoriale  
   
  REGULAMENT | Search | Members | Calendar | Help 
 


Post Reply 
wordpress afisare
01-26-2010, 07:48 PM
Post: #1
wordpress afisare
salut. am si eu o problema. de fapt, nu stiu de unde sa incep. vreau ca in wordpress, sa imi arate pe homepage numai articolele dintr-o singura categorie. cum pot face asta? cred ca trebuie umblat in page.php din thema, dar nu stiu unde..

PHP Code:
<?php get_header(); ?>
        
        <div id="content">
        
              <?php if (have_posts()) : ?>

            <?php while (have_posts()) : the_post(); ?>
            
            <div class="post">
            
            <h1><?php the_title(); ?></h1>
            
            <?php edit_post_link(); ?>
            
            <?php the_content(); ?>
            
            </div>
            
            <?php endwhile; ?>
            <?php else : ?>
            <p><?php _e('Sorry, but nothing seems to match what you were looking for.'); ?></p>
            <?php endif; ?>
            
        </div><!--/content-->

<?php get_sidebar(); ?>
    
<?php get_footer(); ?>

aveti idee? va multumesc.

Acelasi pentru toti, diferit pentru fiecare | Banner 125px GRATUIT
Visit this user's website Find all posts by this user
Quote this message in a reply
01-26-2010, 08:32 PM
Post: #2
RE: wordpress afisare
PHP Code:
<?php get_header(); ?>
        
        <div id="content">

<?php query_posts('cat=ID'); ?> 

<?php if (have_posts()) : ?>

            <?php while (have_posts()) : the_post(); ?>

ID-ul de la cat=ID il inlocuiesti cu id-ul categoriei ale carei posts vrei sa le afisezi.

Vezi daca merge.
Find all posts by this user
Quote this message in a reply
01-26-2010, 08:53 PM
Post: #3
RE: wordpress afisare
nu mergeSad

Acelasi pentru toti, diferit pentru fiecare | Banner 125px GRATUIT
Visit this user's website Find all posts by this user
Quote this message in a reply
01-26-2010, 08:55 PM
Post: #4
RE: wordpress afisare
http://codex.wordpress.org/Template_Tags/get_posts
Find all posts by this user
Quote this message in a reply
01-26-2010, 09:03 PM
Post: #5
RE: wordpress afisare
Deja mi-am prins urechile..

Acelasi pentru toti, diferit pentru fiecare | Banner 125px GRATUIT
Visit this user's website Find all posts by this user
Quote this message in a reply
01-26-2010, 09:32 PM
Post: #6
RE: wordpress afisare
hai ca am reusit. va multumesc. de fapt, in index.php trebuie modificat, nu in page.php, din fisierele themei.

PHP Code:
<?php get_header(); ?>
        
        <div id="content">
            [b]<?php query_posts('cat=13'); ?> [/b]
              <?php if (have_posts()) : ?>

            <?php while (have_posts()) : the_post(); ?>
            
            <div class="post">
            
            <h1><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1>
            <p class="small">Scris de mine la data de  <?php the_date(); ?></p>
            
            <?php edit_post_link(); ?>
            
            <?php the_content('<strong>WAIT! There is more to read... read on &raquo;</strong>'); ?>
            
            <div class="postmeta">
            <h4><?php if(function_exists('the_ratings')) { the_ratings(); } ?></h4>
            <h4>Comments: <?php comments_popup_link('Be the First to Comment''Read the First Comment''% Comments to Read''comments-link''Comments are off for this article'); ?></h4>
            <h4>Filed Under: <?php the_category(', '?></h4>
            <?php if ( function_exists('the_tags')) the_tags('<h4>Tags: <span>'', '' </span></h4>'); ?>
            </div>
            </div>
            
            <?php endwhile; ?>
            <?php else : ?>
            <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
            <?php endif; ?>
            
            <div class="content-bot">

            <?php next_posts_link('&laquo; Inapoi'?>
            <?php previous_posts_link('Inainte &raquo;'?></p>

            </div><!--/content-bot-->
            
        </div><!--/content-->

<?php get_sidebar(); ?>
    
<?php get_footer(); ?>

am adaugat codul de la DarK4EveR . multumesc

Acelasi pentru toti, diferit pentru fiecare | Banner 125px GRATUIT
Visit this user's website Find all posts by this user
Quote this message in a reply
01-27-2010, 11:48 PM
Post: #7
RE: wordpress afisare
npc
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 

 Invatam Net
Esti nou pe aici? Vorbeste-ne despre tine.
Citeste articole si tutoriale unice.
Ai un site? Iti putem oferi un review.

  Parteneri

  

  

  

  

  

  

  Affiliate Banner