Buying Fix Plugin vs Theme error

Discussion in 'Programming' started by danielldf, Feb 4, 2018.

  1. #1
    Im using a plugin called Encyclopedia Pro to create a Glossary. Im using with the theme Soledad (Premium).

    On plugin user pages in getting:

    Warning: Invalid argument supplied for foreach() in /home/******/public_html/*****/wp-content/themes/soledad/functions.php on line 1190

    The line 1190 from functions.php has:
    foreach ( ( get_the_category() ) as $category ) {


    Im paying 5$ bucks with paypal for who solves this first.
     
    danielldf, Feb 4, 2018 IP
  2. cLogik

    cLogik Active Member

    Messages:
    159
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    90
    As Seller:
    100% - 0
    As Buyer:
    100% - 1
    #2
    It's a warning, unless it breaks anything, then just suppress it.

    foreach ( ( @get_the_category() ) as $category ) {

    Place the @ in front, should in theory solve it. The () seems to be unnecessary, you should be able to live with foreach( @get_the_category() AS $category )
     
    cLogik, Feb 4, 2018 IP
  3. danielldf

    danielldf Well-Known Member

    Messages:
    402
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    130
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    Those changes did not effect the error or anything else. Wanna take a look ?
     
    danielldf, Feb 4, 2018 IP
  4. cLogik

    cLogik Active Member

    Messages:
    159
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    90
    As Seller:
    100% - 0
    As Buyer:
    100% - 1
    #4
    Yeah sure, send me a PM with the details.
     
    cLogik, Feb 4, 2018 IP
    danielldf likes this.