Portfolio-Wrapper issues…
-
Hi!
Typical me, I’m never totally satisfied with the stock site. With this project, I’m trying to add a portfolio gallery at the bottom of all my single post pages, “content-portfolio-single.php” So I’ve taken some code from the “Portfolio Template Page” and inserted it at the bottom. As seen at the bottom of this code..
content-portfolio-single.php page…
<?php /** * @package Illustratr */ // Access global variable directly to adjust the content width for portfolio single page if ( isset( $GLOBALS['content_width'] ) ) { $GLOBALS['content_width'] = 1100; } ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header" style="margin-top: 60px;"> <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> <!-- <?php echo get_the_term_list( $post->ID, 'jetpack-portfolio-type', '<span class="portfolio-entry-meta">', _x(', ', 'Used between list items, there is a space after the comma.', 'illustratr' ), '</span>' ); ?> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content(); ?> <?php wp_link_pages( array( 'before' => '<div class="page-links clear">', 'after' => '</div>', 'pagelink' => '<span class="page-link">%</span>', ) ); ?> </div><!-- .entry-content --> <footer class="entry-meta"> <?php /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_term_list( $post->ID, 'jetpack-portfolio-tag', '', __( ', ', 'illustratr' ) ); if ( $tags_list ) : ?> <span class="tags-links"><?php printf( __( 'Tagged %1$s', 'illustratr' ), $tags_list ); ?></span> <?php endif; ?> <?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?> <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'illustratr' ), __( '1 Comment', 'illustratr' ), __( '% Comments', 'illustratr' ) ); ?></span> <?php endif; ?> <?php edit_post_link( __( 'Edit', 'illustratr' ), '<span class="edit-link">', '</span>' ); ?> </footer><!-- .entry-meta --> </article><!-- #post-## --> <!-- INSERT TO CALL PORTFOLIO GALLERY --> <?php if ( get_query_var( 'paged' ) ) : $paged = get_query_var( 'paged' ); elseif ( get_query_var( 'page' ) ) : $paged = get_query_var( 'page' ); else : $paged = 1; endif; $posts_per_page = get_option( 'jetpack_portfolio_posts_per_page', '11' ); $args = array( 'post_type' => 'jetpack-portfolio', 'posts_per_page' => $posts_per_page, 'orderby' => 'rand' ); $project_query = new WP_Query ( $args ); if ( post_type_exists( 'jetpack-portfolio' ) && $project_query -> have_posts() ) : ?> <div class="replacement-portfolio-wrapper"><!-- .portfolio-wrapper --> <?php /* Start the Loop */ ?> <?php while ( $project_query -> have_posts() ) : $project_query -> the_post(); ?> <?php get_template_part( 'content', 'portfolio' ); ?> <?php endwhile; ?> </div><!-- .portfolio-wrapper --> <?php illustratr_paging_nav( $project_query->max_num_pages ); wp_reset_postdata(); ?> <?php else : ?> <?php endif; ?>
I’ve determined the code i’ve inserted will query the posts perfectly. It just doesn’t like the <div class=”portfolio-wrapper”> class for some reason. Although this is the class that works on all other pages to manipulate the portfolio layout. Instead it comes out blank. If I change the div class, all the posts show up perfectly but without the css to put them in columns.
The link below is an example of a page I would like to add a portfolio gallery to after the content… I have replaced the problematic ‘.portfolio-wrapper’ div with ‘.replacement-portfolio-wrapper’ so the content actually shows up, however, without the proper css.
https://leoahrens.com/portfolio/deep-cuts/
If you look at the homepage, that is what it is supposed to look like.
Any help is greatly appreciated!!!!
The page I need help with: [log in to see the link]
- The topic ‘Portfolio-Wrapper issues…’ is closed to new replies.