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:
- How to sort posts by active category in WordPress?
- User filter posts by year
- How to put search bar & logo in the “primary navigation” storefront theme?
- How to add a custom filter (by coding) before access one wordpress page ? And where to call the custom filter?
- how to changes mobile menu toggle breakpoint in WordPress
- How to sort WooCommerce products page by latest in-stock items first?
- Timber right sidebar in WordPress theme
- Create Columns with Custom Walker and CSS Classes
- Applying css in functions.php
- 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 find which .mo file is responsible for displaying a particular localized string?
- Show related products by attribute based and certain conditions
- How to Create custom block for displaying information in content section which act like shortcode
- Background image no longer fits to screen now that project is in php files
- Filter wordpress posts without searching the keywords in the post content
- How to Remove Theme Style CSS inside Custom Plugin?
- Variation prices breakdown only for single product page
- Add css class to string
- How to add a CSS class to this php code [closed]
- Why would the child theme load in the Customize preview, but not on the site itself?
- Test the existence of a page/article by its URL, taking in consideration the URL rewriting by filters
- Filter ‘comment_notification_text’ not working
- Remove Author Links
- Removing links from Grouped products
- Add other class content with reference class value
- How to make only the valid active page of a multilevel menu active with – “.nav li.current-menu-item a”?
- 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?
- How to remove get_header From all single pages in wordpress with functions.php without plugin?
- PHP function for horizontal Woocommerce thumbnails and badges
- WordPress custom php script to match standard page layout
- Use CSS tag inside PHP code
- Apply function.php filter only if url not has /amp/
- I can’t go to the page archive-{post_type}.php
- Change the “Show All” button in a WordPress Portfolio Filter
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- oceanwp+woo mobile cart sidebar text
- Adding Custom css file in the wp-uploads directory with custom php functions
- admin panel – How to remove “delete” button from category editing page
- My top header looks different on single pages but is fine on the home page
- Using php code inside style tag
- New to wordpress. Need Help with templates [closed]
- Child-theme suddenly stopped working [closed]
- Header location [closed]
- It’s not showing full content for posts pages in wordpress “[…]” while customing some changes in the style.css file [closed]
- Blog listing not showing dates for every post and arrow missing off image
- Add a “Next Post” & “Previous Post” styled button manually to a post
- How do I link the side images?
- Parse error: syntax error, unexpected ‘}’ in
- Assign new post author IF another user in custom field on post transition
- Sorting Problem
- Blog Posts not sorted and pagination not adjusted after filtering some category
- Modify meta data before saving to database
- How to create a container in php then customise it in CSS
- Custom HTML/CSS Theme into WordPress – SEO considerations
- hello can you advise how to fix the error?
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- ‘This Field is Required.’ is Not Displaying on CF7 [closed]
- WooCommerce Checkout Cart [closed]
- inner-wrap div pushing custom table far down on page
- How to change wp-admin and wp-login urls
- why css file not link?how to create permalink?
- How to add different menu items on different menus?
- How to pass value to add_filter wpcf7_form_tag from another function?
- Styling best practices for single pages/templates
- Using Featured Image as Hero Background in Word Press
- Custom Filtering date with newsletter
- How to create different templates for woocommerce single-product.php?
- Add text below WooCommerce short description if metabox value is true
- Is there a hook that I can use when a fatal error occurs?
- How rename wp-content and wp-admin folders correctly
- Unable to logout correctly after wp-login file was modified
- how to append ACF field data using one of the following filter/ hooks
- Changing upload directory temporarily
- Add an attribute on WP images attachment link
- Show post in elementor based on views and specific category with query id feature in elementor
- How do I make a shortcode to display Dokan seller badge list?
- Live Preview while customizing is not showing the updates while editing in WordPress
- Editing stylehseet url in head section of WordPress
- Display featured posts first, then display all others within a specific category in WordPress
- Edit password change email text or disable it
- ACF block gutenberg aligncenter don’t work
- Adding Author Filter to CPTs
- How can I display formatted content using the_content filter?
- Sort Woocommerce Products with Numbered Titles Numerically
- separating column the variations from the add to cart button woocommerce
- How can we upload custom page files?
- HELP PLEASE PHP slider css
- Calling a PHP function from a menu item
- Embed dynamic media query in a Gutenberg block
- Get generated block styles programmatically
- Using send_password_email filter after wp_update_user
- Is it possible to remove the “Shop” title from the WooCommerce catalogue? [closed]
- Removing website URL in comments causes misalignment of submit button and tickbox
- How to add global CSS to all webpages without installing any plugin?
- Prevent publishing of uncategorized posts
- WordPress query_posts with multiple tax_query
- Ajax Filters with Multiple tax_query args
- How do I ensure that the URL parameters are updated correctly when multiple filters are applied
- Filtered queries not responeding to page path