Home › Forums › Jevelin Theme › Custom post: author, date, sidebar, related post
Home › Forums › Jevelin Theme › Custom post: author, date, sidebar, related post
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
If you need services beyond standard support, we've got your back!
If you'd prefer not to handle the installation yourself or need help getting started, we'll set everything up for you.
We'll help you rearrange sections, adjust spacing, and modify the page structure to fit your needs.
More complex styling changes, theme option modifications, and third-party integrations.
If you need something that's not included in the theme, we can code it for you.
Web design services to create custom sections, pages, and blocks for your theme, plus graphics and visualizations.
Full website builds, custom theme development, or plugin creation from scratch.
We'll provide a clear quote based on what you need. No hidden fees.