trint
Forum Replies Created
-
Posts query needs to be before $terms = get_terms ?
It makes sense that it doesn’t works but I don’t know how to find the solution.
Forum: Themes and Templates
In reply to: WPExplorer Pytheas theme helpResolved
I updated test website with masonry layout working.
here is the test new version: testHello, I change my mind and my approach :
here is the new code with masonry working like a charm!
However, filters are still not working…
I need to update the test version, still the older one on the server.<?php get_header(); ?> <div id="primary_home" class="content-area"> <div id="content" class="fullwidth" role="main"> <header class="entry-header"> <h1 class="entry-title"><?php echo single_term_title(); ?></h1> </header><!-- /page-heading --> <ul id="filters"> <li><a href="#">Tous les projets</a></li> <?php $terms = get_terms( 'portfolio_tag', array( 'orderby' => 'name', 'order' => 'ASC' ) ); $count = count($terms); if ( $count > 0 ){ //If there are more than 0 terms foreach ( $terms as $term ) { //for each term: echo " <li><a href='#'>slug."'>" . $term->name . "</a></li>\n"; } } ?> <?php // The Query $the_query = new WP_Query( array( 'post_type' => 'portfolio', 'showposts' => '-1', 'posts_per_page' => '50', 'category' => '', 'no_found_rows' => true, 'ignore_sticky_posts' => true, 'orderby' => 'date', 'order' => 'DESC', ) ); ?> <div id="isotope-list"> <?php foreach( $posts as $post ) : setup_postdata( $post );?> <?php $categories = get_the_terms( $post->ID , 'portfolio_category' );?> <?php $artists = get_the_terms( $post->ID , 'portfolio_artiste' ); foreach($artists as $artist); foreach($categories as $category); $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?> <div class="item"> <a>" title="<?php echo get_post_meta($post->ID, 'meta_client', true); ?> - <?php echo get_post_meta($post->ID, 'meta_nom', true); ?> - <?php echo get_post_meta($post->ID, 'meta_desc', true); ?>" rel="lightbox[lightbox]"> <article id="post-<?php the_ID(); ?>" <?php post_class('post-item '. $post_clr_margin); ?>> <div class="homepage_post-img"><?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'secondary-image'); endif;?></div> <div class="homepage_post-img"><?php the_post_thumbnail('medium');?></div> <div class="post-content"> <h2 class="projet-title"><?php the_title(); ?></h2> <!--<h2 class="artist-name"><?php echo esc_attr($artist->name)?></h2>--> <h3 class="client-name"><?php echo get_post_meta($post->ID, 'meta_client', true); ?></h3> <h3 class="project-category"><?php echo esc_attr($category->name)?></h3> <p class="home-content"><?php the_content(); ?></p> </div> </article><!-- #post-<?php the_ID(); ?> --> </a> </div><!-- .item --> <?php endforeach; ?> </div><!-- .isotope-list --> </div><!-- #content .site-content --> </div><!-- #primary .content-area --> <?php get_footer(); ?>
Please help me on this.
Best.Forum: Fixing WordPress
In reply to: Help posts Masonry layoutI found solution by myself. ??
Hello again,
here is the test version for the website: test
here is the back office custom post type fields: screenshot
Tomorrow I’ll insert isotope classes.
Thanks for your support.Hello,
Thanks for your answer.
For the moment I develop with Uwamp on my computer.
I will send it on my server so as to give you an url.
I use a child theme I made from the theme Adamos: https://www.ads-software.com/themes/adamos/
I’ll keep you in touch when it’s done.
All the best.Nobody ?
I think a $post->ID for portfolio terms is missing…
Forum: Themes and Templates
In reply to: WPExplorer Pytheas theme helpI found solution by myself :
<?php query_posts($query_string . ‘&orderby=name&order=ASC’) ?>
just before the loop, it works perfectly !