Default WP Archive Widget and Infocus Excluded Categories Problem

resolved (7 posts) (3 voices)

  1. Hello, I don't know if it's a bug but I discovered that if I exclude one (or more) category/ies (and the related posts) from my blog using the infocus options, I have serious problems using the default WP archive-widget.
    This is what it happens:

    • Suppose you've an article named "Story" posted in "Test" category on december 2010 and that you don't have other articles (except the "Story" article) for december 2010.
    • if I exclude the "Test" category using the Infocus options, the default WP archive widget keeps showing THERE ARE articles for december 2010!
    • In that case, when I click the default WP archive widget link for "december 2010", it opens a "broken page" (very bad!)

    Does anyone already noticed this issue? Is there a solution?

    Thank you (and sorry for my bad english...)

    Posted 1 year ago #
  2. Elliott
    Support

    Hello giggi,

    I see what you mean, thanks for pointing this out to us. What we can do here is if you have posts that are excluded then we can fix the page layout and display a small message saying "No posts were found" or something similar. If this sounds like what you are wanting then download the attached zip file and extract the archive.php file into /wp-content/themes/infocus/

    Let us know if this works for you giggi.

    Attachments

    1. archive-no-posts.zip (2.6 KB, 4 downloads) 1 year old
    Posted 1 year ago #
  3. I know this is an old thread, but I wondered if there's a way to go beyond simply putting an error message on an archive link that doesn't have any posts. Is it possible to have the archives list ignore time periods that don't contain blog entries that are not excluded?

    I've added several portfolio posts that are excluded from the blog and I would prefer if the archives just ignored these entries rather than give the viewer the impression that there is something to see since the time period is listed in the archives. Just as an example, I don't have any blog entries prior to September 2008, but I have several portfolio entries dating back to January of 2004. The archives list implies that there is something for the viewer to see, but in reality they are empty.

    Cleaning up the archives list would be a nice improvement.

    Thanks!

    Mike
    http://www.itsmygallery.com

    Posted 1 year ago #
  4. Elliott
    Support

    Hello Mike,

    It would be possible if we created the archive widget ourselves but since it is a default wordpress feature we do not have access to the code. We'll look into creating our own widget in the future.

    Posted 1 year ago #
  5. Elliott:

    Okay, I get that. I don't use the WP Archives widget so I may have posted my request in the wrong place.

    The only place the archives list shows up currently on my site is on the site map page. I'm assuming that since there's an archives.php file included in the inFocus theme files that the archives list can be altered here?

    Let me know if I'm still barking up the wrong tree with this idea.

    Thanks!

    Mike
    http://www.itsmygallery.com

    Posted 1 year ago #
  6. Elliott
    Support

    As for the sitemap here is the function that is being used, http://codex.wordpress.org/Function_Reference/wp_get_archives. There doesn't seem to be any way to hide a certain month. You can try placing your links manually though. You can find the code in /wp-content/themes/infocus/lib/includes/sitemap-content.php on line 40.

    Posted 1 year ago #
  7. Elliott:

    I've altered the code in the site map so the archives only pull up info for the past 29 months. This eliminates the older excluded portfolio entries from showing up in the archives, but it's not a good fix as I'll have to alter it each month manually.

    Thanks for the help.

    Mike
    http://www.itsmygallery.com

    Posted 1 year ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme