Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1047380
    talpazzo
    Participant

    Dear Support Team,
    I already have a child theme and I would like to create a custom page similar to the category page.
    My goal is to have a “News” page with all the category included.

    This is my template right now:

    <?php
    // TEMPLATE NAME: News (diego)
    // =============================================================================
    // VIEWS/INTEGRITY/TEMPLATE-LAYOUT-CONTENT-SIDEBAR.PHP
    // -----------------------------------------------------------------------------
    // Content left, sidebar right page output for Integrity.
    // =============================================================================
    
    ?>
    
    <?php  get_header(); ?>
      <div class="x-container max width offset">
          <div class="<?php  x_main_content_class(); ?>" role="main">	
     <?php  query_posts('posts_per_page=10'); ?>
    <?php  if (have_posts()) : ?><?php 
    	while (have_posts()) :
    	the_post();
    	?>
    <a href="<?php  the_permalink()  ?>" rel="bookmark" title="Permanent Link to <?php  the_title_attribute(); ?>"><?php  the_title(); ?></a>
    <?php  endwhile; ?>
    <?php  endif; ?>
          <?php  x_get_view( 'global', '_index' ); ?>
        </div>
        <?php  get_sidebar(); ?>
      </div>
    <?php  get_footer(); ?>

    The result it’s not fantastic as I have all the titles at the top of the page and then the news after that. I also would like to have two columns. Can you help me understand what code should I copy from yours templates to achieve something similar to the “category” page (the page with “Below you’ll find a list of all items that have been categorized as”)?

    Thank you very much for your help. Have a nice weekend, Diego

    #1047385
    talpazzo
    Participant
    This reply has been marked as private.
    #1047806
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! Do you want something like this, http://new.your-domain.ch/news-index/ ? If this is the case, all you have to do this:
    1] Create a page entitled “News Index”. You do not have to add anything or assign any page template.
    2] Go to Settings > Reading > Front Page Display and assign the newly created page as your “Posts Page”.
    3] And then you need to go to the customizer, Appearance > Customize > Blog > Style and select “Masonry”. Once masonr is selected, you can choose either two or three column display.

    Hope this helps.

    #1048462
    talpazzo
    Participant

    Thank you very much for your kind answer. I did not thought about this simple solution…
    Absurdly I went to complicate my life with templates and custom codes…

    Thank you, Diego

    #1048858
    Rue Nel
    Moderator

    You’re most welcome Diego!
    We’re glad we were able to help you out.

  • <script> jQuery(function($){ $("#no-reply-1047380 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>