Questions tagged [id]

A unique identifier.

Filter by
Sorted by
Tagged with
0
votes
1answer
22 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, ...
1
vote
1answer
32 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 ...
0
votes
1answer
14 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'...
0
votes
1answer
28 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 ...
0
votes
0answers
22 views

get_current_user_id() doesn't work at all in page template (returns 0)

There are plenty of threads with similar heading, but all of them are pointing out that you shouldn't be calling get_current_user_id sooner than init action. Some people pointed out to use global $...
0
votes
0answers
31 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 ...
0
votes
1answer
23 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 ...
0
votes
0answers
24 views

Use the GET method to get the user id from External API and show all user fields

I'm trying to use the wp_remote_get function to make a call to external api, below the process. The frontend user clicks on the edit profile item. wp_remote_get makes a call which returns the id of ...
1
vote
0answers
19 views

Using featured image from another page

I have the following code which, if a page is a sub-page of 'Portfolio' (ID 12), will use the featured image of the Portfolio page rather than it's own. However, I also have a page of 'Services' with ...
0
votes
2answers
50 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 ...
0
votes
1answer
21 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. ...
0
votes
1answer
12 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-...
0
votes
0answers
13 views

Configure next post id (due WoComerce) to skip several numbers

I have backup and restore a wp that failed and in-between few wocomerce orders are lost (they are in the non working backup) can I set the next wp post (wocomerce save orders as posts, how original) ...
0
votes
1answer
17 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 ...
0
votes
0answers
20 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, ...
0
votes
0answers
16 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 ...
0
votes
0answers
25 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 ...
1
vote
0answers
10 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 ...
0
votes
1answer
25 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.
0
votes
1answer
24 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 ...
0
votes
1answer
14 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 ...
0
votes
0answers
14 views

Create an id without creating an account when adding to the cart

I am currently using Stripe's Rest API for my orders on my site, I have placed the orders without creating an account for a user experience issue because their account will be created later on the ...
0
votes
0answers
14 views

Set a numeric range for post ID generation based on post type?

I'm wondering if there's any way to configure WordPress to assign post IDs like so: Pages ID range: 10000 to 19999 Posts ID range: 20000 to 29999 Custom post type 'A' ID range: 30000 - 39999 Custom ...
0
votes
0answers
26 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 ...
1
vote
1answer
530 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 ...
1
vote
0answers
25 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 ...
0
votes
1answer
206 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 ...
1
vote
0answers
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 ...
0
votes
1answer
26 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?
0
votes
0answers
45 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 ...
0
votes
0answers
962 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-...
0
votes
1answer
10 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 ...
0
votes
0answers
52 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 ...
0
votes
0answers
33 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"&...
0
votes
1answer
201 views

Append USER ID to an outbound link?

Please bear with me as I am a newbie. Is there a way to append a USER ID aka a logged-in user's ID to any external link. For example, a logged-in user clicks a link, the link then appends that user'...
0
votes
1answer
42 views

Get Current Post ID in WP Loop For GiveWP

How to get current ID for WP Loop in my case? I try to loop the GIVEWP (Success), then I try to echo shortcode of GOAL Progress Bar of GiveWP but the problem is, i don't know how to get the current ...
1
vote
1answer
97 views

Get ALL post ID's export list (Only id's. Php or sql not important )

please help me. I dont know How can I do. I need list all posts IDs. export need 1 3 5 6 7 8 9 . . . . Please help
3
votes
1answer
131 views

Is there an equivalent of the PHP function sanitize_key in Gutenberg?

In WordPress's PHP library there is a function sanitize_key used to generate database keys and HTML IDs. I'd like to generate a slug from a title that can be used as an HTML ID, from within a ...
0
votes
0answers
13 views

Consequence of the post auto incrementer off?

I'm moving a site with specific post IDs. If I programatically make a post with postID "4", and the autoincrementer is at "3", what are the consequences? Would it just skip to "5", overwrite 4, or ...
0
votes
0answers
34 views

Safely changing UserID's, re-using deleted UserID's and automatically using deleted userID's instead of an increment

I'm looking for 3 different solutions all relating to user ids, I'm needing a solution to safely make changes without destroying the site. Issue 1: I am wanting to change the userID of a user from ...
0
votes
1answer
448 views

Get post attachment with post id

I have a form where user can upload a file, which creates a post with an attachment. I would like to get this attachment with post id, because this is the only thing I have in my case. Is it possible ?...
0
votes
1answer
26 views

create new users in db starting at what ID?

I have to create several hundred users using mysql. How do I know which user IDs to give them? I don't want to duplicate already-in-use IDs, so is there a way to check which IDs are safe to use for ...
2
votes
4answers
602 views

Getting the wrong page ID

I am developing a theme and I need to get the actual page ID, when I do: global $post; $thePostID = $post->ID; I get the wrong ID. I tried get_the_ID() and I get the same ID that in the code ...
1
vote
4answers
972 views

get_users(…) only returns one user

I have an array of user IDs, I want to get data for each of these users. I first thought of writing a classic SQL query but I found WordPress has integreted functions for it. However, get_users(...) ...
1
vote
2answers
24 views

Always Encounter Using ID in Wordpress as a Final Solution [closed]

I am learning Wordpress Development. I am noticing whenever I encountered a problem I usually check the web for similar issue(s) for the solution. Anyway, what I want to ask is, I've noticed, most ...
1
vote
1answer
213 views

Query Post Object in WP Admin

How can I fetch the details of the $post object of the very post that I'm working on in WP admin? I've tried global $post but I believe that $post is not available during editing. A little context: ...
0
votes
1answer
693 views

Insert post ID into the end of a slug preceeded by a dash

I would like to dynamically insert post IDs into their URL slugs. What I have Code that strips out the prepended post name (WC's '/product') Code that generates the URL that I want What I want ...
0
votes
0answers
199 views

Wordpress user ID prefix

Anyone know of a way to add a prefix to the WordPress user ID when the user registers via WooCommerce checkout? This new user ID format would need to be stored in the WP database in the default user ...
0
votes
1answer
321 views

get_post_meta not working with variable as a post_id for dynamically get the postid

I would like to use the get_post_meta to pull a value from a CPT dynamically and then send a email. The problem is that the get_post_meta($post->ID, ... part of the code does not pull the email ...
0
votes
1answer
170 views

Get attachment URL from attachment Link in WordPress

I have been trying to fetch the URL of image attachments ( e.g. - http:// localhost/mytheme/post-format-gallery/100_5478.jpg ) using their attachment links ( e.g. - http:// localhost/mytheme/post-...

1
2 3 4 5 6