Okay
  Public Ticket #1668381
Different Sidebars and date-problem
Closed

Comments

  • whitecrane24 started the conversation

    Hello,

    I am using different category's for my posts like "news, articles, gallery, videos and downloads". If I go to one of this category's via menu I can see the same sidebar as on startpage. But I want for every category a different sidebar and if possible for all posts of respective category the same sidebar as for category. But how I can see it's only possible if I create pages like "news, articles, ...". But then I have no posts inside this static pages. Is there a solutions like in your demo?

    For the posts I could us the button to enable sidebar. But I cannot change over 20.000 articles one by one ...

    My idea is something like that but for downoloads I have to use the trick with url because I am using downloadmanager and don't know how to check category like for posts ... And I cannot finde any category.php file for category pages. only for single posts ..

    if ( is_category(news) || ( is_single() && in_category(news) ) ) 
    {
    dynamic_sidebar('sidebar_news');

    elseif ( is_category(artikel) || ( is_single() && in_category(artikel) ) ) 
    {
    dynamic_sidebar('sidebar_articles');


    elseif (strpos(('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']),'download') !== false)
    {
    dynamic_sidebar('sidebar_downloads');

    else 
    {
    get_sidebar();

    My second problem is the date. If I have posts I can see "2 Tage ago". In german "ago" is not translated. Do you have a solution for this? Maybe also to change this to a normal date like 2018-07-02


    and third problem is if I donÄt change any header or footer menu it display's me all pages as standard ...

    by the way. is there a possibility to extend the rating system with more criterias?

  •  93
    djwd replied

    Hi there,

    #1. For advanced sidebars management please use a plugin like Custom Sidebars, will allow you to do what you need. The built in sidebar generator is meant for basic usage.

    #2. I'll have a look at this one, meantime you can manually change it in inc/widgets/wg-main-cat.php, line 186

    <?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . __(' ago', 'powermag'); ?>

    #3. Not without custom modifications unfortunately, the limit is 6 criterias.

    Hope it helps

    Regards
    djwd

  • whitecrane24 replied

    Thanks. But with a Widget Plugin for sidebar I am not able to configurate it for categories. Only for single post siites but not for category sites.Am I right????

    1. I used something like that:

    if ( is_category(news) || ( is_single() && in_category(news) ) ) 
    {
    dynamic_sidebar('sidebar_news');

    elseif ( is_category(artikel) || ( is_single() && in_category(artikel) ) ) 
    {
    dynamic_sidebar('sidebar_articles');

    elseif ( is_category(galerie) || ( is_single() && in_category(galerie) ) ) 
    {
    dynamic_sidebar('sidebar_gallery');

    elseif ( is_category(videos) || ( is_single() && in_category(videos) ) ) 
    {
    dynamic_sidebar('sidebar_videos');

    elseif (strpos(('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']),'download') !== false)
    {
    dynamic_sidebar('sidebar_downloads');

    elseif (strpos(('http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']),'forums') !== false)
    {
    dynamic_sidebar('sidebar_forum');
    }
    else 
    {
    get_sidebar();

    I can also use this in wg_sidebar.php and other to check for category. It simply and without plugins. 

    2. I found it, thanks.

    3. But normally it's not to hard to change it. I have only to copy and paste some lines ;)

  •  93
    djwd replied

    Hi there,

    #1. I'm pretty sure with the plugin I mentioned you can attach sidebars to categories as well, sure if you can do it via code that's fine as well. I just mentioned the plugin for ease of use and flexibility.

    #3. I didn't say it's hard just that needs cutom modifications to several files. Then also the front-end would likely need adjusting to fit more criterias.

    Regards
    djwd