• Resolved rudtek2

    (@rudtek2)


    I tried posting on my old account but am having issues, so i hope this isn’t a repost.

    Thank you for this plugin! I’m having a problem though.

    I have my widget shortcode as this:

    [aw_year_links cat="3" postslug="press-release-2"]

    and this displays fine everywhere EXCEPT on the actual page with slug press-release-2

    if i don’t have the sort code on this page the sidebar displays properly, however when i add the page short code:

    [aw_show_posts cat="3" readmore="Learn More" publishedon="n/j/Y" showsubheader="no"]

    i get other widgets showing up (wordpress-default-archives, pages, categories) which are NOT loaded anywhere on my site. Taking the short code back off the page and the sidebar loads with my archives again

    what could be the problem? I’m using the enfold theme if that matters.

    https://www.ads-software.com/plugins/aw-yearly-category-archives/

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author AndyWarren

    (@awarren)

    I’m away from a computer tonight so can’t troubleshoot it right now. If you can send me the page URL along with a WordPress admin login I will check into it first thing in the morning. You can send it privately by going here.

    Plugin Author AndyWarren

    (@awarren)

    Ok, so I think I have this figured out, but I’m not sure how you want me to proceed with it. After looking into it, the two pages you are using the shortcodes on are using different page templates. The page that the year links is on is using a custom template that it looks like you created called template-press-releases.php that is located int he child theme. Then the page that displays the actual posts is using the default page.php template from the parent theme.

    The page.php template has some code in the sidebar.php file that it includes that starts off with “Display a subnavigation for pages that is automatically generated, so the users do not need to work with widgets” as a comment. So that’s where the list of pages is coming from that you said were not included in a widget. You were correct about that. You do have this turned off in page options though.

    Then in the page editor for the page called “Press Release 2” there is an option to select the sidebar you want to use, and it was not set to the custom widget area you created called “News Stories”. Unfortunately, even after I changed that setting to the correct “News Stories” option it still does not display the “News Stories” widgets.

    The only thing that I can figure out is that something with your theme’s default page.php template is blocking you from using custom widgets areas that you create. If I change the page template on the “Press Release 2” page to use the template-press-releases.php template, and set the widget option on the page editor to use “News Stories” widgets, then your sidebar shows up correctly. I’ve left it that way for you to take look at.

    Aside from that, I believe it may be worth contacting the theme author and find out why the default page template won’t allow you to use custom widget areas that you create.

    Sorry about the long post, this was pretty confusing to figure out, and even more confusing to try and explain by typing it out. Let me know if I can do anything else or if you need further explanation.

    Plugin Author AndyWarren

    (@awarren)

    I just thought of something though, if the page that should show the posts is set to use the template-press-releases.php template to get the sidebar to work correctly, you’ll need to add the_content() somewhere in your template file so that the posts will show once you click a year link.

    I’m looking at that template file now, and the_content() is not in there. It should be somewhere in the loop either before or after your accordion code.

    Thread Starter rudtek2

    (@rudtek2)

    Hi Andy,
    Thanks for all your help on this! I’m truly stumped. The problem is that your plugin is working on my custom template and not on the themes page template. Once someone clicks a year link it takes them to the press-release-2 page which is on a normal page template so the content does appear. It’s really the sidebar that’s not working.

    Thread Starter rudtek2

    (@rudtek2)

    Yeah, changing to my custom template works on teh press release page, but i then i have no way of getting to the single-post entries of the press-releases…

    ignoring my custom template at all i created a new page called press-release 2 it should have be on the default template and have a sidebar with the press-release short code. The idea is to transition away from my custom template by customizing yours to look as mine does. so that all yearly pages will have the accordion style. The problem is that your plugin isn’t seeming to work on the same page that the sidebar is leading too. It definitely could be a theme issue, but i’m going to keep trying.

    the other problem is hat on this page (press-release-2) if i take your short code out of the body, the sidebar displays properly as it should. putting the shortcode back in the sidebar is messed up.

    Plugin Author AndyWarren

    (@awarren)

    Can you turn on debugging in the wp-config file, or send me an FTP login via my email?

    Plugin Author AndyWarren

    (@awarren)

    I just took the shortcode out of the page content like you said, and then the sidebar did display correctly, so there is definitely some sort of conflict between my plugin and the theme and/or template files. I’d like to get this figured out for sure.

    Thread Starter rudtek2

    (@rudtek2)

    it’s on. Thanks!

    Plugin Author AndyWarren

    (@awarren)

    So looking at this more, there is a PHP notice on both the press release page and the page that displays the posts after you click a year. It seems to be repeating for each post. It says undefined variable in the theme. I wonder if this could be the root of our issue, causing a conflict somehow?

    To be honest, I am stumped with this one and cannot seem to figure out why its not working. I hate to push blame on the theme, but I do feel like that is the cause right now. This plugin uses basic post queries and I’ve never seen it behave this way.

    Would you mind checking with the theme author and try to resolve the PHP notices and then coming back around to me to see if that resolves the plugin/sidebar issue we’ve been working on?

    Thread Starter rudtek2

    (@rudtek2)

    thanks for trying. i just posted in their support forum.

    Thread Starter rudtek2

    (@rudtek2)

    they still didn’t get back to me, but something else i noticed. I have the plugin setup for 2 categories. both widgets show the same years. So since for instance when i click on 2008 in the news section it returns a blank page because I don’t acutally have any posts in the news category in the year 2008. It’s showing 2008 though because I have posts in the press release category from 2008.

    Plugin Author AndyWarren

    (@awarren)

    Did the theme author happen to get back to you yet?

    I’m not sure I completely understand what you’re saying in your last post about the categories and the year 2008.

    Thread Starter rudtek2

    (@rudtek2)

    they didn’t reply. Don’t worry about the last one..i think that was my error. Thanks for the follow up though. I just asked again on the enfold forum.

    Plugin Author AndyWarren

    (@awarren)

    Ok, Let me know once they reply if the issue is fixed or still persists. Definitely would like to know what the cause and fix for this will be.

    Thread Starter rudtek2

    (@rudtek2)

    ME too!

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘sidebar changing on page shortcode leads to’ is closed to new replies.