Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [id]

A unique identifier.

Filter by
Sorted by
Tagged with
1 vote
0 answers
17 views

How to make search by ID work on front-end?

we created a website where people can post lonely hearts ads. For now we only have a Dutch version available but the idea is to expand to other countries too. It's a great market, and fun to do. But I ...
Frank's user avatar
  • 11
0 votes
2 answers
35 views

category id (term_id) in url instead of slug

For a certain Wordpress shop with woocommerce we need the url to display the category id (term_id) instead of the normal slug with the category name. So instead of www.website.com/categoryname/ it ...
Martin's user avatar
  • 1
1 vote
1 answer
123 views

Wordpress post-template null warnings

I am getting these PHP8.0 Warnings from my WordPress site. The warnings are pointing to core code, not anything custom. When I turn debugging on there are no error messages on the site. I also checked ...
Dawn's user avatar
  • 43
0 votes
0 answers
133 views

Getting the correct post ID in Wordpress query loop

I'm trying to add custom field values inside a Wordpress query loop, so that I can have a list of titles, excerpts, and extras like start ratings in the loop results. I want to use something like echo ...
Marko's user avatar
  • 1
0 votes
1 answer
24 views

How is better to store at DB 1-side relationsip from CPT to many Taxonomies Terms ID's?

Wordpress (with plugin for Custom Fields stored at DB Custom table like Pods/MetaBox/JetEngine/etc) Logic: Custom Post Type (CPT) witch data will be stored at database Custom Table. Custom Taxonomy ...
user234970's user avatar
0 votes
2 answers
131 views

large number (bigint) for post ID issue in database

the ID of my latest post is 796978707878960002. I manually created it using the code below: wp_insert_post(array( 'import_id' => 796978707878960002, 'post_title' => '-test' )); Now, ...
mhdi's user avatar
  • 1
0 votes
1 answer
166 views

How to get post ID after removing that post?

Is it possible to get WordPress post ID after removing that post? I have found out that I need that ID to remove the page from the site map, but I do not have the post ID, becuase I have deleted it. ...
Albert's user avatar
  • 1
0 votes
1 answer
38 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-...
Alipvd's user avatar
  • 3
0 votes
1 answer
23 views

Can I provide a user's user_ID to them and can it also be searchable in a member's directory

We would like a user (student) to have a student ID that they can quote and this stays with them as they learn with us. When they create a profile, by registering on our site is it possible to provide ...
AB_100's user avatar
  • 1
0 votes
1 answer
67 views

Set a minimal number for next user_id

I have a WordPress website with 111 users, I have to import +45000 users who had a predefined user_id starting from 31800001 to 32200905. I know that I can import and set their user_id to their, ...
JARYOP's user avatar
  • 3
0 votes
1 answer
50 views

What is $post->ID

I was going through the following code 'post__not_in' => array($post->ID) but I am unable to understand this. What information does this supply $post->ID
Amit Singh's user avatar
0 votes
1 answer
288 views

Can I Get User ID at Login?

My goal is to allow my users to select their choice of redirect page after login but it doesn't seem that the user ID is available after login? Here is my code. Any help is GREATLY appreciated!!! ...
sifuhall's user avatar
0 votes
0 answers
34 views

Why is my insert row only inserting the final row from the loop into the database rather than just inserting one

<?php session_start(); if(is_user_logged_in()) { global $wpdb; $id = get_current_user_id(); $recoveryID = null; // $results = $wpdb->get_results('SELECT * FROM ...
Sheran Malik's user avatar
0 votes
0 answers
201 views

How to get Previous Visited Page Information

I want to Change for Customized my Contact Form based on Previous URL Visited or We ca say I want to Dynamically Change the Values of Contact Form based on Previous URL Visited. So I had searched and ...
Bhargav Joshi's user avatar
0 votes
1 answer
978 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 $...
Basj's user avatar
  • 85
0 votes
0 answers
110 views

Give ID to divs inside the loop

I'm trying to make this code work on my WordPress site: https://codepen.io/eksch/pen/xwdOeK It is a simple code so that each menu item receives the active class when the user scrolls through the page, ...
Eduardo Reis's user avatar
0 votes
0 answers
68 views

Give custom page template a custom post ID

I created several custom pages in WordPress. One displays real estate listings. When you click on the listing it opens into another custom page I created. The problem is no matter which listing I ...
Joey Lawrence's user avatar
0 votes
1 answer
932 views

How to get ID of Edit User page during wp_handle_upload_prefilter, whilst in Media picker?

I have an Advanced Custom Fields field group on Edit User pages (user-edit.php), containing an Image field (avatar). I aim to rename that uploaded filename to match the username of the on-page user. ...
Robert Andrews's user avatar
0 votes
2 answers
822 views

Form that generates an ID for the customer

I wonder if this is possible on wordpress. In my application I will have a contact form, in this contact form, when filling in the fields, there must be a field that will generate an ID. This ID the ...
WPfan's user avatar
  • 105
0 votes
1 answer
1k views

View post with specific category id and name which I selected in the backend (drop-down option)

I'm trying to get the category ID from Kirki Function and then pass the ID into a loop to get View all posts from that specific category id with name. I write this code at the backend: Kirki::...
Akash Manna's user avatar
0 votes
1 answer
653 views

How to fetch Email addres of an author via ID?

I want to make an HTML form which will have an input field to fill in the ID of the user. Then I want to pass the value into a php code such that the email address associated with that user ID is ...
Sanu_012's user avatar
  • 103
0 votes
2 answers
199 views

Only show tag with the same id as the post

I have been stuck on the following case for a while now. On a page I have a list of tags which I try to filter. When the post for example has an ID of 10586, the only tag displayed should be 10586. ...
codeminator's user avatar
0 votes
1 answer
154 views

Unique IDs for Post Types and Taxonomies

Sometimes I have duplicate IDs between Post Types and Taxonomies, I know this happens because they are stored in different tables but I wish it was possible to have a unique ID for each thing in WP, ...
Nicola's user avatar
  • 127
1 vote
1 answer
461 views

How to add ID attribute to each submenu?

I would like to add an ID attribute to each list <ul> submenu. I am using the Walker class extension. I have managed to modify some elements, but I am left to solve this one problem. I need the ...
nsog8sm43x's user avatar
0 votes
1 answer
4k views

get term id from term name

Hi i am trying to get term id from term name (title ). <?php if ($_SERVER["REQUEST_METHOD"] == "GET") { // collect value of input field $nameb = $_GET['fname2'...
Gidromasservis QSC's user avatar
0 votes
1 answer
1k views

Use post ID in functions.php file adminside

For a functions I need the post ID in my functions.php file. I must have the ID if the editpage is active. What I tried so far <?php //method 1 global $post; my_function($post->ID); //method 2 ...
Jop's user avatar
  • 127
0 votes
0 answers
199 views

Custom Post Type with Sequence ID

I am looking for a way in WordPress custom post type (portfolio) to manage the content of each category with a specific ID sequence. With the "Custom Post Type Permalinks" plugin, I can ...
Gabriel's user avatar
1 vote
1 answer
904 views

How to Extend login session times to a Month

How can I extend wordpress login sessions to a month so that it doesn’t automatically ask for login after 48 hours? I am basically testing some program with wordpress and around 48 hours it fails and ...
Mukeshwar Singh's user avatar
0 votes
2 answers
843 views

How to block specific user id in custom login form?

I've been looking for this method for weeks, but still can't find it. There are so many sites that discuss how to create a custom login page, but they don't cover how to block a specific id like the ...
Ari's user avatar
  • 3
0 votes
1 answer
1k views

Get current user id in function php

I know that this question is already often asked but there is no exact answer for it. I need to get the loggedin user id to change a value in the database for this user. I tried 2 ways it didn't work. ...
Nabil Dabbagh's user avatar
0 votes
1 answer
91 views

How is possible to know ID of taxonomy-{taxonomy}.php page for ACF fields

I created custom post type and custom taxonomy. But I use ACF, and is need to get ID of current page Post type is 'objects'. Custom taxonomy is "objects_category". And page name taxonomy-...
Denis's user avatar
  • 101
0 votes
1 answer
306 views

Get post slug and match with menu item slug to change css

I have a custom vertical menu based on posts of a specific category. I want to match the slug of the menu item with the slug of the current post to apply css. Specifically, I want to change the ...
Kanjoo's user avatar
  • 1
0 votes
0 answers
624 views

WordPress Post ids big increment

I need help with post ids in WordPress. My post IDS went wrong, there is a big prefix before the post ID number. There is a always prefix 1000000 for every new post type (page,woocommerce product, ...
SamM Foolt's user avatar
0 votes
0 answers
21 views

Ad units Div-ids frequently changing

I have a strange issue with my website, the div-ids frequently changing for AD units. How to make them static? I copy the code from the Google ad unit and paste it to my site but the Div-ids ...
Extra Sport's user avatar
0 votes
0 answers
505 views

How can I remove Wordpress element IDs and Class names in the HTML?

Very much following this advice for body class: https://edinburghwp.com/removing-page-post-tag-category-taxonomy-ids-from-body_class-wordpress/ I'd like to remove the IDs and Classes that WP ...
joycegrace's user avatar
1 vote
0 answers
37 views

Is it possible to change post id for an already added menu item in Wordpress?

In Wordpress is it possible to change a post id of menu item (page) that was already added into a menu? Maybe via some custom function? Our menu is pretty big and i'm searching for an option to save ...
Stanislaw's user avatar
0 votes
1 answer
422 views

Do posts, pages and / or custom post type objects have unique ID numbers or can there be multiple objects with the same IDs?

What are the canonical rules for the ID numbers of posts, pages and CPTs? Especially as they are created programatically.
John Dee's user avatar
  • 503
0 votes
1 answer
63 views

post_type internal ID?

This may sound like a stupid question, but is there something like an ID associated with the post types (built in or custom) in WordPress? I'm not interested in the actual post id, but wondering if ...
George's user avatar
  • 3
0 votes
1 answer
129 views

Dynamic Bootstrap Carousel ID per widget on same page

I have integrated bootstrap Carousel into a WordPress widget. Carousel requires a unique ID per each for the controls to work. So if I am using 2 widgets that means 2 carousels on the same page the ...
David Buik's user avatar
0 votes
0 answers
47 views

Trying to get post ID outside loop on blog page

I have a blog index page which only lists 1 custom post at a time on the index page (it is paginated). I am trying to get the ID of that post from outside the loop (in the footer, after the loop) but ...
Gaurav's user avatar
  • 23
2 votes
1 answer
7k views

How to get category URL with the slug?

I have a variable that contains the slug of a category. With that slug I want to create a link to the archive page that displays all the posts in that specific category. What is the best or fastest ...
ralphjsmit's user avatar
1 vote
0 answers
125 views

How to get the upcoming post ID from front end?

Searching with "Next Post ID" is giving me the Previous/Next Post Navigation, but my question is not related to that. In WordPress Admin panel, when we're attempting to create a new post the post is ...
Mayeenul Islam's user avatar
0 votes
1 answer
736 views

How to get an array of pages ID by some page's slug and all its children pages in get_posts() function?

I have a custom function in my theme that creates a dynamic sitemap.xml file. For that I'm using $myVar = get_posts( array(...) ). In that array I need to exclude some pages. I want to exclude some ...
Victor's user avatar
  • 25
1 vote
0 answers
21 views

How to get the post ID's of the five most recent posts [duplicate]

How can I get an array with the post ID's of the five most recent posts? I need it to exclude those posts from a WP_Query / get_posts(). I need a WP_query that skips the first five posts and starts ...
ralphjsmit's user avatar
0 votes
1 answer
129 views

How to I know the class or ID of my theme?

I'd like to know the class or ID of the theme menu I'm using. Is there a way to find this value?
Wall's user avatar
  • 119
1 vote
0 answers
374 views

Reuse old post ID for new post after deleting post

I want to Reuse old post ID for new post after deleting some post. I have a site that has Q&A and I displayed the post ID before the title of each question so that the user / I can guess how many ...
Kaizur's user avatar
  • 61
0 votes
0 answers
2k views

Trying to get property 'ID' and 'post_author' of non-object error

time. Last week I updated to version 7.0 of php and from there it is giving me the following errors: Notice: Trying to get property 'ID' of non-object in web_URL/wp-content/themes/stellenportal/tool-...
Dario B.'s user avatar
  • 155
0 votes
1 answer
30 views

How to only get the content of post page while looping?

so I am working with wordpress and I created a calendar with events (custom post_type). I have a page which shows the calendar with all the event dates from this post_type which works fine. Now I want ...
Horro's user avatar
  • 1
0 votes
0 answers
101 views

get_current_user_id() always return 0 in if else statement

I'm trying to get logged in user id after if else statement but always return 0. When i put get_current_user_id() before it gives correct user id. How can I make it work in if statement? <?php ...
MrLentis's user avatar
0 votes
0 answers
40 views

How to get the url of the entry in which an image belongs

I'm creating a custom attachment template in WordPress, so far so good, but I would like to show the url of the entries or articles where that image belongs somehow? <div class="entry-attachment"&...
Plantas y remedios Caseros's user avatar

1
2 3 4 5
7