Skip to content
Advertisement

Tag: wordpress

Programmatically inserting a widget into WordPress sidebar

I have been using this code on PHP 7.0, but decided to upgrade to 7.4 tonight. This code automatically inserts widgets into Wordpress sidebar, but it no longer works. From my research, it seems to be a problem with “[]” not initializing arrays anymore. I’ve tried every single way I know how, but can’t get this to work. I’ve always

How to hide alt tag output on page?

Please check the screenshot, let me know how to fix this issue…And you can see there’s no image alt data in HTML. Another thing is that if I use PHP in img src so I can’t set width & height like (300 x 300). The output is a full-size image and if I use a static URL in img it

I am trying to use AJAX to change the orderby and order arguments in a WP_Query, but I can’t determine why my code won’t work [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 5 months ago. Improve this question

Adding css class to featured products in woocommerce

I would like to loop throught all products in shop/category page and add special css class to product if it is featured. I have tried to do this with add_filter hook but it seems I am to dumb to get it working. Answer You were right about using a filter. I don’t know which filter you were trying but you

WordPress Loop Post Counter Never Changes

I want to style the first post differently so I am trying to use a simple counter that will add a class to the first post. First, on index.php I have this and then on content.php I have but $postcount is always 1 If I move $postCount = 0; and $postCount++; to content.php the value never changes either. I can

WordPress – Second Custom Role Not working

I have successfully created a custom user role called Client and I am using the same structure to create a second custom user role called Broker. I have been stumped here all morning for something so simple, there is no difference other than the required variables and names. The second user role does not show up in the list when

Google Api PHP Client Syntax Error on PHP 7

OS: macOS Big Sur PHP version: 7.4.1 Package name and version: google/apiclient: ^2.12.3 Whenever I switch the PHP version to 7.4.1 I get this error Parse error: syntax error, unexpected ‘static’ (T_STATIC) in /Users/webtechstreet4/Local Sites/fvtest/app/public/wp-content/plugins/form-vibes-pro/vendor/psr/cache/src/CacheItemInterface.php on line 75 The library works great on PHP 8 but gives the above error when switching to PHP 7. Screenshot Answer Actually, I sorted

Advertisement