wordpress select multiple options and illegal string offset ‘timeslot’ [closed]

You are getting illegal string offset ‘timeslot’ because $time is not an array, it is an item in array $timeslots. You have already retrieved the values submitted using $timeslots = $_POST[‘timeslot’]; Your code also contains other typing mistakes. Here is corrected code: <form method=”POST”> <select name=”timeslot[]” multiple=”multiple” size = 4 required> <option value=”1″>1</option> <option value=”2″>2</option> … Read more

Auto append text after the title?

If I understand you correctly, then the_title hook should help you. You can assign your filter to it and modify the title as you wish: add_filter( ‘the_title’, function( $title, $id ) { return $title . ‘ – Lorem ipsum’; }, 10, 2 );

Load css classes after using ajax calls

Styles won’t be affected if you use different selectors. Create a custom stylesheet, and enqueue it immediatelly. When the page is ready just apply the styles to the mentioned responsive div, or create some logic behind it. So for example if you have <div class=”custom-sidebar”>Some content</div> Enqueue custom style within functions.php wp_enqueue_style( ‘some-custom-styles’, get_stylesheet_uri() . … Read more

How to disable the “Upgrade or Downgrade” button in “My account” of WooCommerce Subscriptions

I have found/made the code that works. Maybe it helps somebody else. /** * Remove the “Upgrade or Downgrade” button from the My Subscription table if user role is “subscriber_plus”. */ add_filter(‘woocommerce_subscriptions_switch_link’, ‘remove_switch_button’, 10, 4); function remove_switch_button($switch_link, $item_id, $item, $subscription) { $user = wp_get_current_user(); if ( in_array( ‘subscriber_plus’, (array) $user->roles ) ) { return ”; … Read more

Disable every rss feed except home feed

// remove_author_feed_link( $link, $feed ); // As we do not pass $link and $feed is empty by default, function just exits function remove_author_feed_link() { return; } add_filter( ‘author_feed_link’, ‘remove_author_feed_link’ ); function remove_category_feed_link() { return; } add_filter( ‘category_feed_link’, ‘remove_category_feed_link’); function remove_search_feed_link() { return; } add_filter( ‘search_feed_link’, ‘remove_search_feed_link’ ); function remove_tag_feed_link() { return; } add_filter( ‘tag_feed_link’, ‘remove_tag_feed_link’ … Read more

How to change header from full-width to box width

If you want to reduce the width of your header , you can do few different methods. If you use bootstrap, add class container to your header, which will add left and right padding to the element. Or you can add your own css. With the given url, I found that your header’s wrap class … Read more