The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
26 views

How do post IDs work in WordPress?

So I have 2 blog posts so far and the first one has ID 8 and second one has ID 12. How exactly does WordPress count those IDs? What if I want to change ID 8 and ID 12 to ID 1 and ID 2? I have some ...
0
votes
0answers
10 views

Pulling Total Count or all post ID's

The following code displays the amount of supporters each of my authors has with my wordpress site. I am trying to display the total supporters on the home page for the whole entire website. I ...
1
vote
1answer
25 views

Display site administrator's id by current blog id inside link

I need to add current subsite admin id on the end of the ref link. For example 1.example.com site admin id is 4 - the link displayed on 1.example.com should look like http://example.com/?ref=4 The ...
0
votes
1answer
20 views

Importing posts from old website to new conflicting post ID's?

I am wondering when I am importing posts from my old site into my new website, which has already some posts in it. Do the imported posts get a new ID or do they overrule the existing posts ID's?
0
votes
1answer
981 views

Add id to menu items in wp_nav_menu

I'm using wp_nav_menu in Wordpress to create my navigation The output is similar to this(I have removed href links) <nav id="pageNav"> <ul id="menu-headernav" class="menu"> ...
0
votes
1answer
897 views

How do I display Youtube/Vimeo video ID on custom post type when user enters it in custom meta box?

I have created a 2x shortcodes that displays a youtube video and vimeo video when the user enters the videos id in it, for example: [youtube id=""] [vimeo id=""]. Instead of entering this in my post ...
0
votes
1answer
28 views

Are post, page and category IDs unique to each other?

I was looking for a function to get all ancestors of a post or category and found get_ancestors( $object_id, $object_type ). To my surprise, the Codex shows that the second parameter is required: ...
0
votes
1answer
37 views

get_post_meta fields don't show up on posts page

I'm new here, and to coding! I've been working hard (so, so hard...so hard) to create my website and with occasional help I've created a look and feel I like using some custom get_post_meta fields for ...
0
votes
1answer
42 views

At my posts archive page, outside the loop, get_the_id() returns the top most post's ID

I'm trying to get the ID of my posts archive page. It's set via the admin as the posts page so it already has the default Query. The template I'm using is index.php, Tried using page-blog.php but ...
0
votes
0answers
34 views

Member's area with private content?

To begin with, sorry for my english.. and thank you Goggle translate! :) I come to speak here because nobody knows answer me in my country. here is my problem: I created a website (in local for the ...
1
vote
6answers
9k views

How to get Author ID outside the loop

I can't get the post author ID outside the loop to make the get_the_author_meta work. So far I've tried different approaches: 1. $author_id=$post->post_author; 2. global $post; ...
0
votes
2answers
2k views

get post author id outside loop

I need to place in post edit dashboard metabox with post author e-mail (or other user meta fields). So it can be edited when admin reviews this post. $meta_id = get_the_author_meta( 'user_email', ...
0
votes
3answers
26 views

ID of Front-Page

I like to get the ID of the selected front page. My page uses an Template for that page. I've read about get_option('page_on_front'), but this didn't work for me. Is there any function to get this ...
0
votes
1answer
759 views

Display 1 category only with get_the_category (by ID or slug)

After hours of unfruitful Googling, I am asking for your help on this issue. My objective is to display only 1 category with get_the_category if the category ID matches the ID or slug set in the ...
1
vote
3answers
2k views

get menu id using its name

I have a menu name Social Network. I want to get the menus ID. I tried the following, but didn't succeed. global $wpdb; $menu_slug = 'social-network'; $menu_id = $wpdb->get_results( " ...
1
vote
1answer
104 views

How can I get an array of all IDs from the current queried object?

I am trying to join an array of post IDs together. Right now, it seems my code is creating a separate array for each ID, instead of one array with each ID. This is the code that I have come up with. ...
0
votes
2answers
110 views

get post id in while loops outputting page id

it's been a while since I used wordpress and I am trying to us e advanced custom fields, I am trying to output the post ID inside a loop on a page, so i can use get_field to output the post contents. ...
0
votes
0answers
42 views

Change id=“respond” to the comments container

On the same page, I have 3 comment threads. Each comment has a meta that tells in which tread they have to be displayed in. At the end of each thread, I have a form to post a comment in this specific ...
0
votes
2answers
30 views

How to get any tag ID

I want to exclude a certain tag from my home page not a category only post that hold the tag for example "olive"; I found a function for that which is like this function exclude_tag($query) { ...
0
votes
1answer
26 views

GET Taxonomy ID

I have this line where "5" is the taxonomy ID. <?php echo function xyz (5,'product_cat'); ?> How can I change this to make it auto recognize always the taxonomy ID of the current page? Tried ...
0
votes
1answer
72 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> ...
1
vote
2answers
99 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
1k 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
52 views

Save attachment ID instead of URL in custom field

I am testing several frameworks (currently Vafpress) to help me creating custom meta boxes. I need to save a lot of attachments with my posts but noticed that the attachment is saved with its full ...
0
votes
0answers
74 views

How to assign custom field an unique number?

I have created a CPT for a client who will use this to manage payments. Their database currently has assigned ID for each of their clients. I have imported the data in a custom field for them. The ...
1
vote
1answer
359 views

getting parent page id when using custom menu.

Im using custom menus to display a menu using wp_nav_menu(). I want to get the_content() of the parent in the menu, without setting it as a parent page in pages. Is there a way to get the parent id ...
0
votes
1answer
75 views

Give a unique ID while saving

I have in my theme custom post types (products) with some meta-boxes. My client asked me, to automaticly give a unique SKU (meta-box) while saving that product. My thought: Give a random ID => ...
1
vote
1answer
730 views

Why id in urls doesn't work and slug yes?

I'm lost, I don't understand why this works http://website.com/?tag=my-cat-slug and not this http://website.com/?tag=15 It's really annoying because wp_dropdown_categories() only provides ids as ...
0
votes
1answer
71 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 ...
0
votes
1answer
27 views

Changing starting number of User ID

I've got a client who would like their online user registration to match their current database. Thus they'd like their wordpress sign ups to start with 00100, I can't seem to find a plugin that ...
1
vote
1answer
1k views

Creating a WordPress admin page without a menu for a plugin

I am writing a plugin, that will list a number of entries from a custom set of tables. I added the main page for the plugin using the following WordPress functions: // Add menu and pages to ...
0
votes
1answer
86 views

Help getting previously visited pages ID

I'm using ACF plugin and I want to pull a custom field from the previous page. I have a WP site that has a homepage and then 20 sub pages. Each sub page is for a specific city and each city has its ...
2
votes
1answer
110 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
0answers
81 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
76 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
35 views

Syling Custom Fields echo's from from functions.php

With the help of User Borek I've managed to get Custom Fields displaying on my siteby putting the below in the functions.php: function custom_field_before_content() { if(is_page() || is_single() || ...
0
votes
1answer
35 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 ...
1
vote
2answers
171 views

Get comment content by comment ID

So I've been trying for a hour or so now to list comment by it's ID. I've tried the get_comment($id, $output) function but it didn't work well, so I went back to whatever is shown below, but it just ...
3
votes
2answers
579 views

How to add the category ID to admin page

I want to add the categories ID to admin page. I call it for my functions.php: require_once('includes/categories_custom_id.php'); The part of code: function categoriesColumnsHeader($columns) { ...
0
votes
0answers
158 views

Infinite scroll jPlayer callback with PHP and post id?

How can I call the correct callback function for infinite scroll plugin on WordPress with variable <?php the_ID() ?> ? I'm trying to connect jPlayer like this: Code in php: <script ...
-2
votes
1answer
70 views

How to get page title with the page ID?

My page ID is: 30601 How can get the title of this ID? I want get page's title with ID.
0
votes
0answers
59 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
49 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
58 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
145 views

On Category page, How can I get the category ID?

This might be very basic question, but I can't really get the category ID on category page (actually a category page of custom type post). Filename is taxonomy-item-category.php & URL is ...
0
votes
2answers
86 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
0answers
153 views

Get ID of the page where shortcode is included

I have a page with a shortcode that uses get_the_ID(). The shortcode displays custom fields from the current page. When I include that page within another page, get_the_ID() returns the ID of the ...
0
votes
2answers
2k views

How do I get the current edit page ID in the admin?

Most solutions I found are for front-end use. This is for a plugin, so the all activity is in the back-end. How do I get the page ID that's being currently use(edited) in the admin? Note I'm out of ...
3
votes
4answers
5k views

How to get page's ID if I know the title only?

Is there an exact opposite funciton to this one: get_the_title(ID) I know there's: get_the_id() But it doesn't seem to accept any arguments. So, basically, I'm looking for something like: ...
0
votes
1answer
130 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 ...