+ Reply to Thread
Results 1 to 4 of 4

Wordpress: Escludere categorie dal file archive.php

This is a discussion on Wordpress: Escludere categorie dal file archive.php within the Wordpress Templates forums, part of the Wordpress category; come faccio ad escludere le categorie usando lo slug, dal loop nel file archive.php??...

  1. #1
    Junior Member Settled In Picaland is on a distinguished road
    Join Date
    Feb 2012
    Posts
    8
    Rep Power
    0

    Wordpress: Escludere categorie dal file archive.php

    come faccio ad escludere le categorie usando lo slug, dal loop nel file archive.php??

  2. #2
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,762
    Rep Power
    11

    Re: Wordpress: Escludere categorie dal file archive.php

    Ciao Piacaland.. allora puoi risolvere coś :
    Code:
    <?php
    $categoria1 = get_cat_id('categoria1');
    $categoria2 = get_cat_id('categoria2');
    $categoria3 = get_cat_id('categoria3');
    $excluded_cats = '-'.$categoria1.',-'.$categoria2.',-'.$categoria3;
    $limit = 10;
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts( 'cat=' . $excluded_cats . 'showposts=' . $limit . '&paged=' . $paged );
    $wp_query->is_category = true; $wp_query->is_home = false;
    ?>
    In pratica ti fà l'exlude by slug con " &cat=-CATEGORIA-SLUG "

    Quote Originally Posted by Picaland View Post
    come faccio ad escludere le categorie usando lo slug, dal loop nel file archive.php??

  3. #3
    Junior Member Settled In Picaland is on a distinguished road
    Join Date
    Feb 2012
    Posts
    8
    Rep Power
    0

    Re: Wordpress: Escludere categorie dal file archive.php

    adattando la query

    <?php
    $categoria1 = get_cat_id('Servizi');
    $categoria2 = get_cat_id('Portfolio');
    $excluded_cats = '-'.$categoria1.',-'.$categoria2;
    $limit = 10;
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts( 'cat=' . $excluded_cats . 'showposts=' . $limit . '&paged=' . $paged );
    $wp_query->is_category = true; $wp_query->is_home = false;
    ?>
    non funziona e non filtra nemmeno le date.. dove sbaglio ???

  4. #4
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,762
    Rep Power
    11

    Re: Wordpress: Escludere categorie dal file archive.php

    <?php
    $categoria1 = get_cat_id('Servizi');
    $categoria2 = get_cat_id('Portfolio');
    $excluded_cats = '-'.$categoria1.',-'.$categoria2;
    query_posts( 'cat=' . $excluded_cats . );
    ?>

    Per "filtra anche le date cosa intendi"?

+ Reply to Thread

Similar Threads

  1. Wordpress archive.php : problemi loop nel template
    By Picaland in forum Wordpress Templates
    Replies: 4
    Last Post: 18-02-12, 21:08
  2. Galleria immagini multi categorie
    By Flep in forum Utilità di FlepStudio
    Replies: 19
    Last Post: 04-01-11, 08:26
  3. Video Player YouTube per categorie
    By Flep in forum Utilità di FlepStudio
    Replies: 20
    Last Post: 04-07-10, 16:23
  4. creare un menu categorie
    By anarky85 in forum Actionscript 3.0 avanzato
    Replies: 3
    Last Post: 18-12-08, 18:58
  5. Gallery Categorie
    By gianlucafg in forum Off Topic - Libera la mente
    Replies: 1
    Last Post: 12-05-08, 07:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts