You are using array_push() incorrectly.
Do this:
$classes[] = 'new-class';
Or this:
array_push( $classes, 'new-class' );
But not:
$classes[] = array_push( $classes, 'new-class' );
Related Posts:
- the_author_posts_link css class
- Change comments form title on a page by page basis
- Display only text to WordPress loop without loosing the text formatting
- Remove class that has been added by parent theme
- append PHP function to the_content
- wp enqueue style and style sheet depth
- CSS saved & enqueued, but wordpress doesn’t load css text, only file
- How do I know what variables are passed in a filter/action and what their meaning is?
- Is it possible to use the featured image of a page as a css background without inlining?
- How to display a value from a radio button in the options menu in wordpress
- Woocommerce filter cart and category specific quantity [closed]
- How should I best target dynamically served content?
- How to scale image with equal width and height without distortion?
- php syntax – how to concatenate properly – echo bloginfo(‘stylesheet_directory)
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- How to call function at the bottom of post using plugin?
- An unwanted inline style is added to my body tag
- Get different images for mobile and desktop with php, advanced custom fields without using js and ajax
- Handling Body class based on Template
- How to stop featured image thumbnail [set as background image] on blog index page just repeating same image across all posts
- Selectbox in admin panel function linking to CSS
- Using if/else statements with output from theme options
- How do I add custom bulk actions to multiple custom post types?
- Show prices with tax in Woocommerce Mini Cart [closed]
- Add filter when image is uploaded?
- Remove a div from RSS feed
- How to display pictures from database?
- Whats the proper way to use a php stylesheet in a wordpress theme? [duplicate]
- Adding logo to WordPress header
- Thumbnails appear to be zoomed
- Alter required message using comment form api
- height should be set to auto to avoid pixelation in the post thumbnail function
- Change page title from page using php via php executed from page/post itself
- Override a function defined in wp-includes/comment-template.php
- Add Codepen animation as Preloader to WordPress
- Reduce size of responsive title
- Clickable image link sends people to wrong URL
- Creating a mobile site by adding a new class to the body tag from functions.php
- Removing WordPress Footer -without access to PHP code?
- Upload multiple files in randomly generated folder using wp_upload_bits
- How to have different site identity logos on each page on Astra Theme [closed]
- Get the_content surrounded by instead of
- Post repeated when opening in overlay, how do I solve this? [closed]
- Displaying content on posts page based on category
- Can I remove or edit an include() from a function with a filter?
- Dynamically adding filters
- Assign Custom classes to every Excerpt
- Adding a navigation page state to individual blog and portfolio pages
- apply_filters with several different values?
- Inline CSS header style priority function.php Child (no enqueing I think)
- How can I modify this code to make the search box include tags and meta
- How to put search bar & logo in the “primary navigation” storefront theme?
- How to sort WooCommerce products page by latest in-stock items first?
- How do I make these combination select filters work when only one dropdown is set? They work in WordPress 5.8.2 but don’t in 5.8.3
- How to add a CSS class to this php code [closed]
- echo cutom css code to WordPress page template file ? is this safe?
- How to run php code only for a specific widget on a page and not all widgets on that page?
- Use CSS tag inside PHP code
- Warning: Use of undefined constant all – assumed ‘all’ (this will throw an Error in a future version of PHP) in C:\Users\…….. on line 6
- I want to hide “sold by” on certain pages with id page 43
- Fatal error: Uncaught Error: Class ‘WP_Block_Styles_Registry’
- using filter and hook inside class
- How to bind each “the_content” elements to a custom variables
- how to add functions to my function.php using a child theme?
- Replace header with large image on home page only, using Genesis child theme
- Filter portforlio with librairie isotop
- add_filter() inside another add_filter()
- Redirecting the lost password page request when using a custon login page
- PHP/CSS: Shortcode won’t display correctly, and only displays in the head (before content)
- Custom Bulk Actions handler not firing
- Using Sprit-sheet on WordPress categories
- Add class for the_post_thumbnail_caption()
- How to include different html tags in the header for different pages?
- CSS loading as empty file in Custom Theme
- Font-Family does not looks like how it should be [closed]
- Where to find the html for WordPress site? [closed]
- How to add style in functions.php depending on conditions?
- Modify arguments for parent theme’s `wp_register_style` via child theme
- Hide button based on PHP result
- How to have Function of a plugin using global vars into a shortcode?
- Child theme not working properly
- Cant get theme to change footer color through theme customizer
- Changing 2011 theme header image based on user dropdown
- How to change the menu color
- How to change a specific character in a theme option value – replace a space with a plus sign
- How do I get Roboto Google Font to display normal font-style? [closed]
- Using PHP for background-image property [closed]
- Child-theme suddenly stopped working [closed]
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- How to pass value to add_filter wpcf7_form_tag from another function?
- Add text below WooCommerce short description if metabox value is true
- How rename wp-content and wp-admin folders correctly
- Unable to logout correctly after wp-login file was modified
- Editing stylehseet url in head section of WordPress
- How can we upload custom page files?
- HELP PLEASE PHP slider css
- Is it possible to remove the “Shop” title from the WooCommerce catalogue? [closed]
- How to add global CSS to all webpages without installing any plugin?
- WordPress query_posts with multiple tax_query
- Filtering with Attributes – how to display all non-queried products below query