Why I can not I use the variable outside my function?

The problem here is order, the $post variable isn’t available from the moment WordPress is loaded, it needs to process the request, put together a database query, and retrieve the post first. Time travel is necessary for your code to work as you expected. Your themes functions.php and plugins will be loaded before this happens … Read more

how would i change post->ID to work correctly when querying pages?

Try with get_the_ID() $image_uploaded_meta_id = get_post_meta(get_the_ID(), ‘_listing_image_id’, true); get_the_ID() is a core WordPress function that acts directly inside the WordPress Loop, retrieving the id of the current item being loaded. $post->id is not working because the variable $post has no scope inside the loop. Here’s the link to the documentation: https://developer.wordpress.org/reference/functions/get_the_id/

Crazy Question – Updating Post ID

First off, I have no idea WHY you would want to do this. IDs are unique for a reason. If you change the ID, I can only see it creating more problems than it solves. Can you explain why you want to do this? I’m sure the community could give you an alternate solution. But … Read more

Insert post ID into the end of a slug preceeded by a dash

The rewrite argument in register_post_type is limited, but you can define a more complex structure with add_permastruct. The added benefits are that this will generate all the rewrite rules for you, and the new rules will overwrite the originals. You just have to be sure to hook after the post type is registered. function wpd_woo_product_permastruct(){ … Read more

create new users in db starting at what ID?

You don’t give them IDs. The user ID column in the database is an ‘auto increment’ column, meaning that the value is automatically created whenever a row is added. So just add your users without an ID and the database will create one for you.

How to I know the class or ID of my theme?

I have just noticed you have solved your problem after I wrote this answer. I’m posting it anyway for future visitors. Various web browsers have an “Inspect” function built in, for example; Firefox, Google Chrome, Chromium, Bravve etc. How to Inspect pages Load up the page you want to examine in an appropriate web browser … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)