The tag has no wiki summary.

learn more… | top users | synonyms

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
6answers
6k 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
859 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', ...
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
28 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
1answer
550 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
0answers
36 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 ...
0
votes
1answer
547 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"> ...
1
vote
1answer
46 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
41 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
624 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
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 ...
0
votes
1answer
18 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 ...
0
votes
1answer
106 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
38 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
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
1k 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( " ...
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
32 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
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 ...
1
vote
2answers
56 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
451 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
96 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
57 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
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
103 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
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
0answers
62 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
865 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
4k 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
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
2answers
179 views

get the_title_attribute by id

I'm creating a list with a few permalinks which I call to with <a href="<?php echo get_permalink($id); ?>" title=".... And for the title I want to call the_title_attribute(). But it seems it ...
0
votes
1answer
186 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. ...
-3
votes
2answers
85 views

Query parsing only author ids

I need array only all author ids from the loop, each one only once if possible and out of all posts in the loop. Any suggestions?
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
1answer
59 views

get id custom tables on current page

i will get id on current page. <?php $hasil = $wpdb->get_results("SELECT id,bab,tema FROM $tabel ORDER BY bab ASC"); foreach ($hasil as $bab) : ?> <tr> ...
1
vote
1answer
102 views

How to call widget by widget's id?

Is it possible to call widgets using it's id? for example I have a sidebar. In this sidebar I put meta widget and tag cloud widget. I have got their id's ($widgets_list): 'meta-2' and 'tag_cloud-2'. ...
0
votes
1answer
390 views

post_author for wp_insert_attachment

I am working on a custom theme, in which I need to programmatically inserts posts and attachments. One requirement is those posts belong to users that are not the user who is logged in and running ...
1
vote
2answers
728 views

How to obtain the user ID of the current profile being edited in WP-Admin?

Is there a way of obtaining the user ID of the profile being edited in wp-admin? I know it's in the URL if you are editing a user, EX: ./wp-admin/user-edit.php?user_id=427. Could always ...
0
votes
0answers
48 views

Using array page name together with page id to deregister script

If I use this: if (is_page(array(blabla-test-page, 20726, 20720, 38881))) {wp_deregister_script( 'gdsr_script' ); } the blabla-test-page looks like it overrides different pages, even if certain ...
0
votes
0answers
44 views

Show ID's in main section of my own page

I've included wordpress in my own website and I use the main section of the blogs aswell as the sidebar. In the sidebar there are shortcuts that lead to Id's Cat=01 p=01 etc. Everytime I click them ...
0
votes
1answer
26 views

Using class id from array for query

I'm using Event Calendar 3. Since there seems to be no easy way of querying all upcoming events as posts, I tried it this way, getting the IDs from the DB and querying the posts from that: <?php ...
0
votes
2answers
120 views

Function to grab specific image IDs from media library.

I want to grab images 161 thru 166 without having to calling my entire media library array and having to splice those up. In time, the more I have in there the more it's going to slow my site down. ...
0
votes
2answers
283 views

get USER ID in functions.php using user_register action

I am having trouble of getting the ID in user_register filter in functions.php... Here is what I got add_action( 'user_register', 'sendanotheremail' ); function sendanotheremail($user_id) { ...
-1
votes
1answer
42 views

Where to add the code for an outer container in a theme?

I have a Wordpress theme installed (SimplePress) and I would like to add an outer container to it, and I don't know exactly in which file should I add the code. This is the code I tried to use: ...
0
votes
1answer
1k views

get_posts by id not working

I have the following code: global $post; $current_post = $post->ID; $array=range(1,$current_post); $posts = get_posts('numberposts=5&post__in=' . $array . '&category='. ...