Tagged: child theme, code, posts
-
AuthorPosts
-
October 5, 2016 at 2:24 pm #695488
I made a new custom template to show an archive page for my blog posts but formatted in a very specific way. The problem now is that what it shows the posts, nothing from the text editor shows up including some stuff I had done in the Layout Editor.
I’m am 90% sure it’s because I didn’t include some code from the other templates to make it work but if someone could please let me know what needs to be added, that would be great. I have included the current code for the page.Thank you!
<?php /* Template Name: HFF Ideas Archives */ get_header(); ?> <div class="site-content"> <div class="site-content-inner"> <div class="post-content-wrapper"> <?php $archive = new wp_Query(array( 'post-type' => 'post', 'post_per_page' => 20 )); ?> <?php while ($archive->have_posts() ) : $archive->the_post(); ?> <div class="post-content"> <div class="post-content-inner"> <span class="archive-category"> <?php $categories = get_the_category(); $separator = ' / '; $output = ''; if($categories){ foreach($categories as $category) { $rl_category_color = rl_color($category->cat_ID); $output .= '<a href="'.get_category_link( $category->term_id ).'" style="background:'.$rl_category_color.';">'.$category->cat_name.'</a>'.$separator; } echo trim($output, $separator); } ?> </span> <?php the_post_thumbnail('Ideas_Pages_Thumbnail'); ?> <article class="post-area" style="background: <?php echo $rl_category_color; ?>;"> <div class="post-title"> <h3 style="padding: 20px;"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> </div> <h5 style="padding: 5px 0px 25px 20px;"><?php the_time('F j, Y'); ?></h5> </article> </div> </div> <?php endwhile; ?> </div> </div> </div> <?php get_footer(); ?>
October 6, 2016 at 11:42 am #695969just to clarify, nothing the Avia Layout Builder or anything added via the normal text editor shows up using the page template. The loop runs but I can’t add anything to that page.
October 10, 2016 at 1:32 pm #697297Hi,
Please copy enfold/page.php and enfold/includes/loop-page.php files to your child theme in the same path and change them as needed to add new page template – https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/
Best regards,
Yigit -
AuthorPosts
- You must be logged in to reply to this topic.