All Questions
Tagged with get-the-id wp-query
4 questions
0
votes
1
answer
39
views
after refresh the id that shows correct in first time click, changes to 1
I made a like post type for another post type called recipe that user can toggle for like and getting back the like.
I have to get the latest like id of specific single recipe when cliked on in data-...
0
votes
1
answer
1k
views
get_the_ID() in the footer returns wrong value
I'm using get_the_ID() in footer.php but it returns a wrong value.
It might come from any of the plugin which is altering The Loop without resetting it after with wp_reset_postdata() as mentioned in $...
0
votes
0
answers
79
views
Why does my output of get_the_ID() change after a wp_query?
I use ACF.
I have the following code:
$args = array(
"post_type" => "membership",
"posts_per_page" => 1,
'meta_query' => array(
'relation' => '...
0
votes
1
answer
1k
views
Global page ID variable empty error
I am creating theme and I have a need to create global variables within theme functions.php file.
Currently I am doing it like this:
/**
* Setup globals
*/
global $nb_id, $nb_page;
$nb_id = ...