This:
$thm_out[array_rand($thm_out, 2)]
is the same as
$them_out[array(0,2)]
where 0 and 2 are 2 random keys.
See array_rand
I hope you can see what is wrong there. Change that to:
$thm_out[array_rand($thm_out, 1)]
which is the same as
$them_out[2]
where 2 is any random key.
Related Posts:
- How to get the registered sidebar’s name by its id?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- One button to change all settings in theme customizer?
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- Design view breaking on Pages
- How the functions in WP are called in tags
- Add a Second Menu to a theme that only support 1 menu
- Can’t load WP function into external function
- Set WordPress Default Template
- Where in PHP do I move title and meta (date) to bottom of each blog section?
- WordPress add post format support not working
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- How do I link a button I created in theme customizer to a function?
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- get_template_directory adding FTP root folders in urls
- blank white page when post/update/change option etc
- Displaying Slider in Front Page (home) using Customizr Theme
- How can I assign separate stylesheets to different pages?
- How to make sure relative URL works when site is not on root domain?
- call a string/function from database
- Some problems calling a function into sprintf() inside functions.php template file [closed]
- Dynamically switch file in get_template_directory_uri() | Function [closed]
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- remove_action from parent theme using child theme functions.php
- File from parent theme imported to child theme doesn’t work – any ideas?
- How to use data URL in WordPress?
- How to override theme’s public static function inside of a trait?
- how to use 2 index.php file One for mobile and one for desktop
- Menu to the right of screen on desktop using Bootstrap 4
- Need help with Deprecated: Non-static error when update PHP 7.4 -> 8.1 with Dyad 2 theme
- a problem in class in class-wp-hook.php
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- Displaying Logged-In User Name in WordPress Menu
- Autoloading in Child Theme
- Genesis – Customize search form
- Set media upload attachment link to none and hide it in WP v3.5
- How to add default images into theme customizer image control?
- Successful or Error Message after running mysql code in functions.php
- How can one utilize a variable as a callback function name for add_settings_field
- Custom Logo URL | Help me print the URL of the custom logo I inserted into my theme
- How do themes render caption texts in extended markup (e.g. “wp-caption” paragraphs)
- Count the number of times the search form template gets included on a page
- PHP code inside shortcodes
- Adding Default Settings to Theme My Login plugin
- function to assign user role based on a field from usermeta
- WordPress Gravatar filter is removing my custom attributes
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Remove echo from shortcode
- Copyright info change – Corporate Plus Theme PHP [closed]
- Inject class in body when particular page template is used
- How to list posts from a plugin taxonomy?
- wp_force_remove_style’ not found
- Filtering a function’ output for a new continued function
- Pagination on Custom Post
- Deleting Certain terms from appearing on the front end as links
- first instantiated SimplePie object cosumes 5mb?
- Theme not calling Jquery properly
- WordPress redirect redirecting too many times or not at all
- how to save checkbox data for custom setting?
- How to keep the capability of users and disable Gutenberg editor in WordPress?
- If Array Values Match Another Array’s Values, Then
- Enqueing External JS on the remote server JS
- Open and closed function [closed]
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- How to add aria role and schema markup to custom walker container
- Genesis / custom template page / setting the page title and meta desc
- Must filter functions receive all arguments passed to them?
- How to Display a List of Child Pages For a Parent Page in WordPress
- Why in this WordPress theme I can’t see the Main Menu?
- How to add PHP pagination to wordpress
- Taxonomy term description with style, only if the description exists?
- Restrict post to current user in postmeta
- How to change the author box selection on a post to a custom taxonomy
- How to send a php var to jQuery Ajax call with two different file
- copy fields value to another field
- not outputting medium size image URL
- Get parent category name when only child category is applied to a product
- Best way to use variables in multiple functions?
- Can an AJAX callback function access a PHP variable which was defined during initial page load?
- Adding product permalink on admin order page throwing error
- Before & After Content – After Content directly below Before Content when using require_once
- Cannot fetch posts with certain ‘product_cat’. WP_Query is empty
- Detect what link user clicks and Redirect to a specific page for logged in users only
- How fix error in the WordPress loop?
- Editing existing pre-created menus in PHP
- Use WP_Query Data In Cookie
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- Help with my first Metabox helper class
- ISOTOPE – Missing/Invalid Arguement Get Terms
- doubled content
- Themes with variable width or single columns? I want to display source code
- Showing all post from all post type in admin backstage
- Pagination not displaying
- Setting WooCommerce currency programmatically
- Masking external links with internal link for member-only
- Shortcode to include PHP file, pass various parameters to include?
- Why can’t I include echo inside a variable? [closed]
- Alternative to php echo within code
- Add multiple HTML attributes to an Elementor button
- /page/2/ redirect to 404