1
vote
2answers
32 views

Does an article (post) id ever change?

So I'm working on a plugin for wordpress, and a novice at it as well. I need to use the ID of a wordpress post, or blog article rather, as a unique reference id, or lets say in database terms, a ...
1
vote
1answer
35 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
51 views

The loop starting at a certain ID

Is it possible to start the loop from a certain post ID? I would like to get all the post starting at a certain ID, decendingly. To explain, I have to make sum assumptions first. Assume that my ...
2
votes
1answer
82 views

How can I display a specific user's first published post?

I'm looking for a way to display a user's first published post using their unique ID. I have a function that calls a list of specific users using their IDs, and would like to display the date the ...
0
votes
1answer
47 views

linking to post outside the loop

Is there an easy way to link to a specific page/post outside the loop? I used the get_permalink() code as follows. <a href="<?php echo get_permalink( 164 ); ?>/post-slug/"> </a> ...
0
votes
0answers
43 views

Using Post ID and Page ID in same function

I've written a function to display a custom sidebar, which is outputted as a sidebar. On some pages, I have a Custom Field called 'show_sidebar', which I can assign as 'false' on pages which I do not ...
0
votes
1answer
29 views

Are all ID's used unique?

I'm using JSON api plugin to pull data from wordpress into an app I am making. I need a unique identifier to make sure I don't have any duplicates WHILE also using the identifier as a way to sort from ...
0
votes
0answers
42 views

Gravity Sum list column with post_after_submission

I want to make sure I'm doing this right. I have a gravity form with a list field with three columns. Basically, Product Name | Quantity | Notes I want to sum the value of all the values in the ...
0
votes
3answers
47 views

obtain the author id given the post id

If $a contains the ID of a certain post, how can one obtain the corresponding author ID? I've tried with $b = get_post( $a); $c = $b->post_author; $d = $c->ID; but it does not work.
1
vote
2answers
54 views

Post-ID in url differs from $post->ID

I've got a page with a blogroll in the left column and a sidbar in the right one. When I try to retrieve the page-id inside of the sidebar like: echo $post->ID; echo get_the_ID(); The result is ...
0
votes
2answers
83 views

Is there a better, more efficient way to get the post id outside the loop?

Right now I am using: $wp_query->post->ID; I want to know if there is a better way for getting the post id that consumes less resources?
0
votes
1answer
87 views

Why is my Blog Page ID == First Post ID?

It is possible that I'm doing something wrong. Currently I'm using index.php as the main blog page. I have a page setup for the Blog and set it up in my Settings. When I try to get the Blog Page ID ...
0
votes
1answer
98 views

$post->ID displays wrong ID

This one is pretty weird. This code: $post->ID Displays right ID every time excepting the blog page (the page set as blog on /wp-admin/options-reading.php). On that page $post->ID returns the ...
0
votes
2answers
186 views

Widget to show posts in the sidebar basing on its IDs

I am trying to create a widget that displays posts in the sidebar taking post IDs as input from the user. The result of my code is that the widget displays just the first entered ID and ignores the ...
-1
votes
1answer
1k views

How to get the post's parent ID?

I have a template which outputs the blog posts (Blog Page), I open one of the posts which use single.php template, Now how can I get the ID of it's parent which is the (Blog Page)? I should say that ...
0
votes
1answer
47 views

unused post IDs

Recently I installed plugin called Delete-Revision and noticed that every post has registered few post IDs. I usually use save drafts and update post a few times when I write a post. Here's the ...
0
votes
2answers
110 views

Get a post's ID

How do I get a post's ID? I know I can use the_ID(), but I have to use it in The Loop. How can I get the post's ID without the loop? Because I think using the loop just to find the post's ID will slow ...
0
votes
1answer
70 views

Making posts permalinks consistent numbers

I'm developing a new website, but I can't quite figure out a solution to my permalinks problem. My main website is http://w3spine.com, I'm sending posts to my second WP installation at ...
2
votes
1answer
5k views

get all posts ID from a category

Problem: I need to get an array of ID's of posts from a given category If the category have any posts. This is to be used on a plugin options page. So far I have: $posts = ...
0
votes
1answer
70 views

retrieve the oldest post id

I'm trying to get the ID of the oldest post with the post_type = job_listing and post_status = publish. I'm using the code below but it does not work. Could anyone please help me $oldestID = ...
0
votes
2answers
1k views

How to get ID of the page included with get_page()?

I'm rewriting the question, including exemplary code, I hope it will be easier to understand now. 1. My shortcode: function testid_shortcode( ) { global $post; return ...
1
vote
1answer
643 views

Get the post_id of a new post

There are several ways to get the id of a post after it has been saved (auto, etc.), but is there a way to get the post id immediately after you create a new post? I am trying to create a directory ...
0
votes
1answer
158 views

Can a page_id and a post_id be same?

Wordpress generates ID's for each page/post. Do pages in wordpress share the same ID column in the database as the posts? I mean, if a site has both posts and pages, can one or more page_ID's be same ...
0
votes
1answer
252 views

How to get post id of last approved comment?

Can you help me with something simple? How can I get the post id of the last approved comment? I want to assign it to a variable. Thanks so much in advance!
4
votes
1answer
1k views

Get page ID of page that is set as the posts page

In WordPress settings you can set a page as the Posts Page. This can be found: WP-Admin->Settings->Reading Settings->Front page displays How do I retrieve the page ID that is set in this ...
1
vote
1answer
592 views

current post with current author

how can i check if the current post belongs to the current author? this is my basic code; ` if($curpost) { wpuf_edit_show_form($curpost); } else { $error = ...
0
votes
1answer
2k views

How to get the post id (of the parent custom custom type) in a loop inside a widget?

Below there is a widget with a Wordpress loop inside. It works as expected. The only problem is this part: 'post_parent' => $post->ID, The widget is not getting the post->ID of the parent ...
0
votes
1answer
2k views

Getting post id from wp_insert_post_data function?

I'm trying to use the function get_the_tags() from outside the 'loop'. I understand this can be achieved by using the post ID like get_the_tags($postID). Does anyone know how I can get the post ID ...