Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter Elena

    (@elenapanzalis)

    Thank you for your response.
    I will check next updates! ??

    Elena

    Thread Starter Elena

    (@elenapanzalis)

    Thank you very much! It works perfectly! ??

    Thread Starter Elena

    (@elenapanzalis)

    I just tried another code like the last one I posted:

    <?php  $query = new WP_Query( 'tag=tag_slug&orderby=date' );
    
                // The Loop
                if ( $query->have_posts() ) {
                echo '<ul>';
                while ( $query->have_posts() ) {
                    $query->the_post();
    
                 $terms = get_the_terms( get_the_ID(), 'authors' );
    
                    foreach ( $terms as $term ) {
                        $term_link = get_term_link( $term, 'authors' );
                        echo '<li><a href="' . get_the_permalink() . '">' . get_the_title() . '</a></li>';
                    } ?>
    
              <?php
                }
                echo '</ul>';
                } else {
                    // no posts found
                }
            /* Restore original Post Data */
            wp_reset_postdata();

    In this case it calls all the posts with ‘tag_slug’ of ALL the taxonomy terms, not only the current. I think because the while loop.

    There’s any solution with one of these codes?
    I don’t know what to do.. ??

    Thread Starter Elena

    (@elenapanzalis)

    mmm it doesn’t work.
    For the tags filter i put the slug of the tag without problems. ??

    I added another thing to the sidebar days ago: the description of the author in the custom taxonomy.
    Taxonomy: authors
    Name: ElenaP
    Description: Description of ElenaP

    I called it with this code.

    <?php $terms = get_the_terms( get_the_ID(), 'authors' ); ?>
    
    <?php foreach ( $terms as $term ) { ?>
    <div class="info-authors">
    <p>
    <a href="<?php echo get_term_link( $term ); ?>"><?php echo $term->name; ?></a>
    </p>
    } ?>

    With this code I can see ElenaP’s description in the sidebar, only in articles with ElenaP value.
    Do you think something like this could work?

    Thread Starter Elena

    (@elenapanzalis)

    Ok, now it works. yeah!
    I can see a list of posts from the same taxonomy ‘ElenaP’ and filter by ‘tag1″.

    But… now you are gonne kill me…

    Do you think it is possible call the post list by CURRENT TAXONOMY?
    ‘terms’ => $current-taxonomy,

    Thread Starter Elena

    (@elenapanzalis)

    It doesn’t work. ??

    But I don’t even know if it is the right way to do it.
    Maybe there are others methods to do it…?
    For example display a list of posts by current custom taxonomy and filter by category instead of tags? Or others methods?

    Thread Starter Elena

    (@elenapanzalis)

    yes, sure. ??
    Sorry I paste the code directly from the codex. In my case it would be:

    $args = array(
    	'post_type' => 'post',
    	'tax_query' => array(
    		array(
    			'taxonomy' => 'authors',
    			'field'    => 'slug',
    			'terms'    => 'tag1',
    		),
    	),
    );
    $query = new WP_Query( $args );

    I try to explain better:
    I have a single post where the ‘author’ taxonomy value is “ElenaP”. I would like to display the posts related to “ElenaP” value from taxonomy and filter by tag ‘Tag1’.

    do you think it’s the better way to do it?
    I don’t know what to do..

    Thank you

    Thread Starter Elena

    (@elenapanzalis)

    Hi Alexandra,

    I didn’t solve the problem but we changed ideas for the project.. So I don’t need a solution anymore ??

    Thank you anyway

    Elena

    Forum: Fixing WordPress
    In reply to: Permalinks
    Thread Starter Elena

    (@elenapanzalis)

    By default it shows the pages empty (with logo and banner but not informations), IIS 7.5

    Thanks

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