1
vote
1answer
33 views

Get current post id in functions.php

I have a wp_localize_script() function in my functions.php where I need to push the current post ID of the current post to a jQuery file. So I was wondering how you can get the current post ID of a ...
0
votes
1answer
39 views

Get posts by list of post IDs ordered by those IDs?

I am going to make a "favourite" posts box, but the article id's are stored in another DB so I only get an array of IDs (which are relevant to the WP DB). I think it could be done with get_posts() or ...
0
votes
1answer
185 views

Compare “Main” post ID to ID inside wp_query loop

I have a video viewing section on my site. The single post template displays a large area where the video plays and then there's a column of thumbnails representing other videos along the right side. ...
0
votes
2answers
114 views

Determine if ID is page or post and query the ID

I want to look up a page id and determine if it's a page or post. Then query that id and display stuff like title, featured image, etc. This works for Pages: query_posts('page=' . ...
0
votes
1answer
2k views

Display posts from an array of ID's

The result of the query so far is the print of the array, Array ( [0] => 309 [1] => 10 ), 309 & 10 are the correct id's of the posts I want to display, and "No posts were found" the result of ...