Using Post ID and Page ID in same function
Using Post ID and Page ID in same function
Using Post ID and Page ID in same function
At the db level you can add one more field to wp_users and create trigger that fills this field on row create. That said, this can cause issues with wp updates in the future. Another option would be to create view that shows rows from wp_users and calculates that special Id for you. Afterwards, you … Read more
If you’re on a taxonomy term archive page, you can access the current ID via get_queried_object_id(): echo function xyz( get_queried_object_id(), ‘product_cat’ ); You can also access the whole term object with get_queried_object(): $this_term = get_queried_object(); echo $this_term->term_id; echo $this_term->name; echo $this_term->description; echo $this_term->taxonomy; echo $this_term->parent; echo $this_term->count;
which gives me all posts inside the tax inspiration – I need to alter this, so that I get only selected ID’s in my array, ex. 4714, 3608, instead of all terms of the tax. I’m assuming you mean that this query gives you all posts inside post type inspiration and you want to pull … Read more
Get id from database
WP DB Location for “Next Post to Create” Index Value
You can add ID’s to thumbnails like this. <?php $attributes = array( “class” => “main-image portfolio ” . $extraLastClass, “id” => “photo_” . $post->ID, ); the_post_thumbnail( “large”, $attributes ); ?> Notice I have append id with $post->ID.
The values assigned to $user_set_value should be stored somehow in some form, usually an option. You will know how the values and where the values are stored. It is easy then from there $user_set_value = get_some_saved_option_value(); $args = array( ‘page_id’ => $user_set_value ); $q = new WP_Query( $args ); Just change get_some_saved_option_value() with the actual … Read more
One solution would be to create a page with a page template that gets all info based on the user ID. Then you can add that page to the menu. Something like this: <?php /* * Template Name: User Info */ get_header(); //Your code for getting the users id $user_id = ‘123’; //Output userinfo using … Read more
You can use the same method as described in the link you mentioned, but simply use the created user ID and add 1000 so you get four digits. So user_id = 5 gets the meta number of 1005. add_action( ‘user_register’, ‘my_on_user_register’ ); function my_on_user_register( $user_id ) { $unique_id = 1000 + $user_id; update_user_meta( $user_id, ‘my_unique_id’, … Read more