Support » Plugin: WP Bannerize Pro » PHP: categories with slug/id not shown,using single banner id w. slug is working

  • Resolved sledolter

    (@sledolter)


    Hi!

    I used the PHP-code you provided in the tutorial. When using:

    if( function_exists( 'wp_bannerize_pro' ) ) {			
      wp_bannerize_pro( array( 'orderby' => 'random', 'categories' => 'sidebar' ) );
      wp_bannerize_pro( array( 'orderby' => 'random', 'id' => 'test2' ) );
    }

    only the direct call is shown, as the other is not there, only the empty bannerize-div. It’s not working with the categpryID either. The slug I am using should be the right one, I also looked up the relations in the database, all data is there. Also in the backend all information is there.

    I tried it with a second category and a new banner, but it’s behaving the same, with categories not output, with ID and slug its working fine.

    What can I do to find the error?

    Thx,
    Steef

    • This topic was modified 1 year, 7 months ago by  sledolter.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author gfazioli

    (@gfazioli)

    @sledolter interesting, I will check asap

    Ok, I tried to debug it, putted the $cat_array into a session-variable and wanted to check the output, got the category-id back, now I changed back to the slug for testing and afterwards the banners were shown.

    Only thing I can think of is a typo, but I copied the slug from backend to verify there is no typo. Also the second test category is working now (sidebar), and both is working with ID and slug now. *happy*

    One difference I know is, first I was coding with notepad++ on my desktop computer, the uploads and the only change ($_SESSION[‘cat_array’] = $categories_array;) now I did from my notebook with phpStorm.

    Edit: maybe some problem with the coding in Notepad++, had that once when a php-file was saved as UTF-8 with BOM resulting in incorrect HTML-structure. After removing BOM all was normal again.

    Edit2: or maybe some caching problem? Since some firefox version caching seems weird, had it often, that after uploading new version of a website, first the new version was shown and new scripts were used and after some changes and refreshing sometimes with F5 suddenly firefox was showing the old version till I manually cleared the cache. Even if it used to show the new version before.

    Thx for the simple, but powerful plugin.

    Peace,
    Steef

    • This reply was modified 1 year, 7 months ago by  sledolter.
    • This reply was modified 1 year, 7 months ago by  sledolter.

    What exactly does rank_seed do when set to true?

    Plugin Author gfazioli

    (@gfazioli)

    @sledolter The rank_seed options is useful when you are ordering the banners with impressions count. Let’s say that you have 3 banners A, B and C with 10,5 and 2 impressions. Of course, the banner A will be displayed always on top. So, if you want to give a chance to the rest of banners to be displayed on top as well, you may use the rank_seed options for that.

    • This reply was modified 1 year, 7 months ago by  gfazioli.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP: categories with slug/id not shown,using single banner id w. slug is working’ is closed to new replies.