This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

helpers.php php warning

  • Creator
    Topic
  • #21504
    vtheme
    Participant

    With wp 4.2.1 and Akita 2.1.8
    Recently upgraded my theme to the current one and am getting this warning in my server error logs:

    PHP Warning: Illegal string offset ‘all’ in
    blah/blah/wp-content/themes/akita/framework/includes/helpers.php on line 214

    Any idea of what may be causing this or a way to fix?

Viewing 15 replies - 1 through 15 (of 19 total)
  • Author
    Replies
  • #21505
    Jason Bobich
    Keymaster

    Hi,

    On the line of the file in question, change this:

    } elseif ( ! empty( $options['categories'] ) && ! $options['categories']['all'] ) {

    To this:

    } elseif ( ! empty( $options['categories'] ) && ! empty( $options['categories']['all'] ) ) {

    … And it should clear it up for you.

    #21506
    vtheme
    Participant

    Thank you so much! – I added the line, but is there any way to force the condition to see if the error repeats?

    I received about 10 of them last night, but am not sure what provoked the call.

    #21508
    Jason Bobich
    Keymaster

    I’m pretty sure this will get triggered, if you setup a post grid or post list element (NON paginated), and then under the source for the posts select to pull from categories.

    #21510
    vtheme
    Participant

    ok, I dont see the error, but just noticed that my homepage template post grid slider broke.
    It had certain categories selected, but with that line change, all categories are showing. When I replaced the original, the slider works as expected.

    I will continue to see if the errors generate…..

    #21512
    Jason Bobich
    Keymaster

    Sorry, I see the typo I made. The line should be this:

    } elseif ( ! empty( $options['categories'] ) && empty( $options['categories']['all'] ) ) {

    Change to this and then check for your error and make sure your post grid works properly.

    #21516
    vtheme
    Participant

    Looks like that did the trick!

    Thanks a ton – if I see the error again I will let you know.

    Appreciate your fine work – thanks!

    #21520
    Jason Bobich
    Keymaster

    No problem!

    #21550
    vtheme
    Participant

    Sorry to have to revisit this, but I am now getting this error:
    PHP Fatal error: Cannot unset string offsets in /blah/blah/wp-content/themes/akita/framework/includes/helpers.php on line 217

    The adjusted code in my edited helpers file is;

    //orig } elseif ( ! empty( $options[‘categories’] ) && ! $options[‘categories’][‘all’] ) {
    } elseif ( ! empty( $options[‘categories’] ) && empty( $options[‘categories’][‘all’] ) ) {

    unset( $options[‘categories’][‘all’] );
    $categories = ”;

    line 217 is the unset(..) line

    Any idea of what I can do to fix this?

    #21554
    Jason Bobich
    Keymaster

    Can you show me a screenshot of how your element around selecting the categories is configured in the Builder when you’re getting this? And do you know what version of PHP you’re running?

    #21556
    vtheme
    Participant

    PHP Version 5.4.38

    I am not sure where this is being generated from, but when the system broke this weekend, it was on my home page in Post Grid Slider element in my HOME template.

    The screen shot would take about 5 pics – do you want them all?

    The settings are:
    Transistion: Slide
    Speed: 0
    Show Nav: yes
    Show arrows;: yes
    Show pause/play: yes
    Where to pull posts from: Category
    (there are about 12 categories selected from the 50 or so)
    Number of posts: 9
    Order by : publish date
    Col: 3
    Rows: 1
    Order ; desc

    (there may be another place that this error is generating from…. not sure!)

    Let me know if you need anything else

    WAIT !!!:

    I see where the error is coming from and it is NOT the home page…

    [post_grid_slider columns=”3″ rows=”2″ fx=”slide” timeout=”4″ nav_standard=”true” nav_arrows=”true” pause_play=”true” categories=”gallery” numberposts=”-1″ orderby=”rand” order=”DESC” offset=”0″]

    #21557
    vtheme
    Participant

    Also on another page :

    [post_grid_slider columns=”4″ rows=”4″ fx=”slide” timeout=”0″ nav_standard=”true” nav_arrows=”true” pause_play=”true” categories=”species-profile” numberposts=”-1″ orderby=”title” order=”ASC” offset=”0″]

    #21558
    Jason Bobich
    Keymaster

    For designating the category, try using “category_name” param and not “categories”

    http://shortcodes.themeblvd.com/generator/shortcodes-sliders/post-sliders/

    #21559
    vtheme
    Participant

    yep, that did it.

    This worked for at least 2 years, I guess I didn’t expect that shortcode to change – so sorry to have bothered you on this one.

    I should go back and check if there were other changes like that that may affect other pages I may not have caught yet.

    Thanks again.

    #21560
    Jason Bobich
    Keymaster

    I think the idea was to leave it so it would still work, even though not the desired way. And so all that was happening originally was yielding a minor php warning. I have put little catches for those things in the shortcodes plugin but I’ll check again on that one.

    #21561
    vtheme
    Participant

    Nice to know that all the little pieces are tidied up for all of us.
    Thanks again.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The forum ‘Akita Responsive WordPress Theme’ is closed to new topics and replies.