Custom post: author, date, sidebar, related post

Home Forums Jevelin Theme Custom post: author, date, sidebar, related post

Home Forums Jevelin Theme Custom post: author, date, sidebar, related post

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Hi,

    I’ve created my own template single-mycenter.php for my custom post Centers. Also custom taxonomy (one category, “Location”) for those post. 

    Author and date. I need that only post with this template don’t show author and date. I’ve removed the following code in my single-mycenter.php but still show author (and date).

    <?php /* Show information about author */ ?>
    <?php if( ( !defined('FW') || ( isset($elements['athor_box']) && $elements['athor_box'] == true ) ) && get_the_author_meta( 'description' ) ) : ?>
    <div class="sh-post-author sh-table">
    <div class="sh-post-author-avatar sh-table-cell-top">
    <?php echo get_avatar( get_the_author_meta( 'ID' ), '185' ); ?>
    </div>
    <div class="sh-post-author-info sh-table-cell-top">
    <h4><?php the_author(); ?></h4>
    <div><?php the_author_meta( 'description' ); ?></div>
    </div>
    </div>
    <?php endif; ?>

    And
     
    <?php echo jevelin_post_option( get_the_ID(), 'post-quote-author' ); ?>
     
    2. Sidebar. In single-mycenter.php I’m calling “sidebar-mycenter.php” here
     

    <?php if( isset($layout_sidebar) && $layout_sidebar ) : ?>
    <div id="sidebar" class="<?php echo esc_attr( $layout_sidebar ); ?>">
    <?php get_sidebar('sidebar-mycenter'); ?>
    </div>
    <?php endif; ?></p>

     
    But It’s not working either… (but it’s shown ok in “Widgets” section).
     
    This is my code for funcions
     

    function registrar_sidebar(){
    register_sidebar(array(
    'name' => 'Mycenter',
    'id' => 'sidebar-mycenter',
    'description' => 'Centros PIR',
    'class' => 'sidebar',
    'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    'after_widget' => '</aside>',
    'before_title' => '<h2 class="widget-title">',
    'after_title' => '</h2>',
    ));
    }
    add_action( 'widgets_init', 'registrar_sidebar');

     
    And this is for sidebar-mycenter.php

    <?php if ( is_active_sidebar( 'sidebar-mycenter' ) ) : ?>
    <div id="widget-area" class="widget-area">
    <?php dynamic_sidebar( 'sidebar-mycenter' ); ?>
    </div>
    <?php endif; ?>

     
    3.Related post. Not sure how to do this (supposed to be here “<?php /* Show related posts */ ?>”), but I want to only show related post with “Location” category (I mean, only Centers custom post should be shown).
     

    Thank you 🙂

    Hi @kykm,

     

    I hope you are well today and thank you for your question.

     

    Could you please share me the page URL from your site where it is displaying so that i can help you to remove them?

     

    Best regards,
    Shufflehound team

Viewing 2 posts - 1 through 2 (of 2 total)