Skip to content

Tag: wordpress

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

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

I am trying to load the script into my Elementor Widget and i am getting a Failed to load resource: net::ERR_CONNECTION_REFUSED on my WordPress

Error screenshot Failed to load resource: net::ERR_CONNECTION_REFUSED Answer It is properly enqued already and the errors you’re getting are for the different script and the script you’ve enqued are already showing the Console.log() test message you’ve added. I see there is no problem with enqueing the script, you might be dealing with some other issue, please continue with debugging.

Serving a page to any URL that ends in its slug

Still new to WordPress, so please go easy on me. Goal: Prevent users of a specific role from viewing other custom post types made by users of same role. Intended solution: Modify the URL and redirect to a custom 403 page when the user ID doesn’t match the post author. As such, if the person attempting to view example.com/%taxonomy%/%private-post-slug% would

ACF & WordPress Media Library

I’ve got an ACF ‘options page’ with a placeholder image within, to fall back to if a client removes the image from the post/page by mistake. And I’m using the following code to handle this situation happening. This works fine once pages or posts are saved. However The issue I have is if the page/post has been previously saved with