hi
is it possibile to assign to a specific category or a specific tag only (i.e. in our case https://www.greenplanner.it/tag/greenict/) a custom sidebar?
how can we do? and is it possibile to assign also a custom header (with a dedicated adv position)?
thanks
to better explain what I need… I already created a specific tag-ID.php file for the tag I needd to customize
in this code… how can I indicate to use a specific header and a specific sidebar?
<?php
get_header();
$current_tag_name = single_tag_title( ”, false );
?>
<div class=”td-container td-category-container td_category_template_1″>
<div class=”td-container-border”>
<div class=”td-pb-row”>
<div class=”td-pb-span8 td-main-content”>
<div class=”td-ss-main-content”>
<div class=”td-page-header td-pb-padding-side”>
<?php echo tagdiv_page_generator::get_breadcrumbs(array(
‘template’=>’tag’,
‘tag_name’=>$current_tag_name
)) ?>
<h1 class=”entry-title td-page-title”>
<!–<span><?php esc_html_e(‘Tag’, ‘newsmag’); echo ‘: ‘ . $current_tag_name ?></span>–>
<span><?php echo $current_tag_name ?></span>
</h1>
<?php //the category description
$td_tag_description = tag_description();
if (!empty($td_tag_description)) {
echo ‘<div class=”td-category-description”>TAG: ‘ . $td_tag_description . ‘</div>’;
}
?>
</div>
<?php
get_template_part(‘loop-archive’ );
tagdiv_page_generator::get_pagination();
?>
</div>
</div>
<div class=”td-pb-span4 td-main-sidebar”>
<div class=”td-ss-main-sidebar”>
<?php dynamic_sidebar( ‘td-default’ ); ?>
</div>
</div>
</div> <!– /.td-pb-row –>
</div>
</div> <!– /.td-container –>
<?php
get_footer();
Hi,
The sidebar can be add per category in theme panel -> https://i.imgur.com/qGp8S9h.png unfortunately the the sidebar per tag can not be set individual only global -> https://i.imgur.com/8GaygO1.png> also the Newsmag theme do not have any option to can set a different header per specific pages, sorry.
What you need it can be achieve using a custom code. You can get some more details about how to do this from this article:
-> https://blog.templatetoaster.com/wordpress-custom-header-per-page/
Hope this will help you!
Thank you!
thanks Calin,
regarding the sidebar… how can I in the specific tag code call a custom sidebar?
I imagine is possible to change this call <?php dynamic_sidebar( ‘td-default’ ); ?>
the header is more complicated… I just need to have a custom ads banner in the tag page…
Paolo
Hi,
The file use for tag page is this one wp-content/plugins/td-composer/legacy/Newsmag/tag.php normal I think that you can use some php code to see if is a specific tag -> https://i.imgur.com/4dMWRON.png and then in a side the if condition to set the sidebar code with a shortcode or something for the specific sidebar.
Unfortunately, this can be done only custom, also I do not have the proper skills to can help with this custom requirement, I can direct you to theme files and so on, but I’m not a developer to have code skills, sorry!
Thank you for your understanding!