devinsays / portfolio-press

A WordPress theme for artists and designers to showcase their work.
https://wptheming.com/portfolio-theme/
GNU General Public License v2.0
62 stars 30 forks source link

Undefined offset when viewing posts archive #99

Closed devinsays closed 9 years ago

devinsays commented 9 years ago

I get the following message when trying to display an archive list of posts for a particular date:

Notice: Undefined offset: 2 in /Library/WebServer/Documents/wp-linda/wp-content/themes/portfolio-press/extensions/portfolio-helpers.php on line 154

I had a quick look at the code which is not checking the length of the $matches array returned and hence it can fail if the array has only one element.

Link: https://wordpress.org/support/topic/notice-undefined-offset-when-viewing-posts-archive

https://github.com/devinsays/portfolio-press/blob/master/extensions/portfolio-helpers.php#L152

Wolsten commented 9 years ago

Thanks Devin

devinsays commented 9 years ago

Removed the code that displayed the gallery. Should fix this: e9caeb9a1f2556ce2b8aa803098a8c89406cfa91