The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
0answers
34 views

How to pass multiple page ids from a custom field variable into post__in wp_query

I have a client that wants to pull content from multiple pages using page_ids listed in a custom field (363, 87, 95) without interfering with the main loop content (can't use sub-pages as same page ...
0
votes
1answer
24 views

Getting an ID from a URL, why can WP do this itself, but none of of the functions provided get it right?

I have a set of absolute URLs that have been used to refer to my site (they come from redirects in an old .htaccess file in this case). All of these URLs do resolve to some page or post on the site. ...
-1
votes
2answers
28 views

get_pages gives wrong ID for blogpage

I have a problem with get_pages. It displays the wrong ID for the blog page. I have tried this code. $pages = get_pages(array("echo" => 0)); foreach($pages as $page){ echo $page->ID; } ...
4
votes
2answers
131 views

What is an alternative to get_page_by_title()?

I'm coding a theme where I want to display information in the footer that's only available on a template page. I have been using get_page_by_title() which works well if you know what the page will be ...
0
votes
1answer
20 views

retrieve permalinks of posts inside custom post type by using post ID

I have these custom post types registered as shown in the image below - In each of these custom post types, there are many posts. I have the function to retrieve the post IDs of each posts inside ...
0
votes
1answer
18 views

Buddypress activity id

I am working on buddypress activity loop. I want to get current activity id or all activity parameters in entry.php file. but i am not able to get activity id. I am trying to use ...
0
votes
2answers
104 views

Get the current post ID as a variable in Javascript

I'm trying to echo the post ID in a post Javascript and not having any luck. var post_id = '123'; // works fine var post_id = '<?php global $post; echo $post->ID; ?>'; // echos 'ID; ...
0
votes
1answer
22 views

Associating special meaning with user id 0

I'm writing a plugin that creates a custom table holding data which is linked to a user account with a user_id field. Now if that users account would be deleted for any reason I would like to set that ...
0
votes
0answers
13 views

Reverse Locate Gallery by ID - NOT ID but location on website!

This has befuddled me a few times and my searches only tell me how to find the ID of a gallery which I know. I am helping a friend with her Wordpress blog, I did not set up the site and I see she has ...
0
votes
1answer
34 views

Get the correct post id for all post and page in header.php

I want to get the current post/page id outside the loop (in header.php) and use this id for Advanced Custom Fields plugin to get the fields. But i cant get the correct id from front page, archive ...
0
votes
1answer
19 views

Retrieve ONLY mp3s and set a variable for use in a playlist called by single.php template?

I'm trying to stuff a variable called $work_ids with the ID of any attached MP3 files for use in a custom player (based on MediaElement.js if that matters). The library contains WAV and other versions ...
0
votes
0answers
16 views

Sort products by products ID

is there a way to define an url like this one: http://www.mydomainname.com/product ID 1234 and product ID 5678 If yes which should be the correct syntax. Thanks for the help Roc
0
votes
0answers
42 views

Getting wrong ID

I have a page template with a custom query. The query displays posts from a post type. I want to display the ID's of the queried posts, but when I use this... <?php $id = the_ID(); ?> All I ...
2
votes
2answers
151 views

Is post ID number always incremental n+

I have one question. Will WordPress always assign new post post ID which is incremental n+? For example if I delete some posts, will WordPress use ID of deleted post for new post added in future?
0
votes
1answer
21 views

CPT posts in drop downed in meta box on page doesn't return post ID

I have an issue with displaying ID of selected post. Could you guys help? thanks Function below add_action( 'add_meta_boxes', 'cd_meta_box_add' ); function cd_meta_box_add() { add_meta_box( ...
0
votes
2answers
79 views

How to get home page ID?

I'm building a Wordpress plugin in which I need to get the HOME page ID value. Do you know how can I get it? I know that we can get the current ID with the_ID() or get_the_ID() function, but I need ...
-2
votes
1answer
30 views

how can i get the page_ID in nav li [closed]

I need a menu with the page IDs of the linked Pages in the li Tags. It should look like that: <ul id="menu"> <li class="pageid_23"><a href="page1">Page 1</a></li> ...
1
vote
2answers
169 views

Get All IDs Of A Post Type Using WP_Query

I am trying to get a list of a custom post type's IDs using WP_Query, but it is returning undesired result, which is a memory leak and stuck browser. Here is the code I use: $the_query = new ...
0
votes
0answers
154 views

Generate auto seqential ID number when a new user is registered

First off I found this solution to what I would like to do: generate an auto incremented id number when a new user is registered It is almost there but I would like to extend the functionality a ...
2
votes
1answer
30 views

Does the menu item ID ever change?

Does the ID Wordpress gives each menu item ever change? id="menu-item-1234" I've linked to it within my CSS, however this will be no use if this ID may change, for instance when the page is ...
0
votes
3answers
44 views

Custom post type returns bad post ID

I added custom post type and I have first problem. I don't know why but if I use $post->ID, independently of post ID it always gave me the same value. I'm using this function <?php the_post(); ...
0
votes
2answers
102 views

Is it possible to have dynamic post id # in add_menu_page()?

I use the add_menu_page function in my custom theme builds but when I export my local copy of the site and import it in the production site some of post id numbers change and I have to update this ...
0
votes
1answer
54 views

Set post tags using tag ID

I want to set post tags to a new value. Is there a way to use the tag ID to do it? The wp_set_post_tags only accepts the tag name or an array of tag names. <?php wp_set_post_tags( $post_ID, $tags, ...
0
votes
1answer
75 views

Generate unique number when registering a new user

I know there are userID, username in the database, but I want a formatted and unique number for physical world use. For example: "2014xxxx" 201414:year,xxxx:generate randomly when registering a user. ...
0
votes
1answer
68 views

php return username of currently viewed author profile

I'm at a loss. I have profiles developed for my wordpress website, and I want to display content on my page-profile.php that is specific per user profile. I've looked all around the codex and only ...
0
votes
1answer
66 views

Subcategory IDs in relation to parent category ID switch case

I would like to switch ads tags in my footer depending on which category it displays at the moment. Code from below works fine for custom category pages and category pages that are included in the ...
0
votes
2answers
275 views

How to get page_id for url rewrite or how to use page slug for calling a page?

I would like to simply create an url rewrite that takes the third argument and matches it to its corresponding pages, ignoring the other two arguments. domain.com/argument1/argument2/page-slug = ...
0
votes
1answer
14 views

Is there a function to search for a wildcard value when calling a shortcode?

I'm using a plugin to generate a form and rather than inserting the form on to the page using the content editor I'm adding it directly to my template. The problem is that on my local version the id ...
0
votes
1answer
41 views

How to view WordPress' default category IDs?

It seems that Wordpress has default categories with default (and unchangeable) IDs. For example, the uncategorized category seems to always have an id of 1. Is this always the case? Is there any ...
0
votes
1answer
36 views

Get post or page id early

Is there a good solution to get the queried object id really early ... and i mean really early? I got a hook on after_setup_theme where i need to get the post or page id. ...
0
votes
1answer
619 views

generate an auto incremented id number when a new user is registered

First off I found this question: generate unique number when registering a user which is almost exactly what I need except I need the number generated to be auto incremented instead of random. I'd ...
0
votes
1answer
149 views

WP_Query custom field pass the post id

I'm using WP_Query with ACF(Advanced Custom Fields) I'm building a news portal, and I'm trying to pass related stories from 1 post which is top_story = true. In another WP_Query I want to print the ...
1
vote
2answers
400 views

Get a post_id where meta_value equals something in a serialized meta_value field

I'm storing CPT products' post IDs into CPT companies' post meta (meta_key = prefix_products). As a company can have multiple products, so I'm storing them into a PHP serialized array value. ...
0
votes
2answers
319 views

How to change WordPress user ID?

Is this enough to change the user ID? I'm doing this for security purposes, where the administrator has user ID=1 and I want to keep all posts, pages and content. UPDATE wp_posts SET ...
0
votes
0answers
36 views

Add menu item for page with ID

I'm trying to leave Wordpress for my client as a simple and usefull CRM, but I stuck with one thing. I have one page with few main sections (groups of products). I don't want to separate every section ...
0
votes
1answer
68 views

main menu page redirects to user ID

I have a site that displays fitness results to clients. It works by showing them a page based on their UID displaying unique charts and graphs etc. I can redirect members to the unique pages on ...
0
votes
0answers
31 views

wp_get_attachment_link add post id as query arg

Hello i would like to add a query argument at the end of the href in the image gallery. So for ex: where 36 is the id of the post where the gallery is. This is the code i'm using inside a ...
0
votes
0answers
43 views

Page auto link to the ID

I'm trying to make the page slug as their ID. Because I'm making one page site. Here is my code <?php global $post; ?> <article id="<?php echo $post->$post_name; ?>"> then I ...
0
votes
0answers
21 views

html <nav id wordpress menu

I am trying to convert this html menu to a nav in wordpress <nav id="nav-main"> <ul> <li><a href="#">Home</a></li> ...
0
votes
0answers
64 views

Unique widget id to target specific part of widget

I am currently trying to target widget part after title and collapse it on smaller screen where title would be a toggle. This is in my footer area and there are 3-4 widgets that I want to collapse on ...
0
votes
3answers
74 views

Output Post ID for all nav_items

I seek a solution for my navigation in a new WordPress template that I'm developing. How can I output the unique post ID for every nav item? I want to create a one-pager (microsite) for a client. ...
1
vote
1answer
2k views

Can't get post ID in functions.php?

I need the current post id in a function , which I have written in functions.php. But I can't get the id . I have tried several method . Like get_the_ID() ; ----returns false global $post; ...
0
votes
2answers
195 views

Get page content by ID (from a plugin)

I'm stuck on loading page content by id (through a plugin). What I have is the following: <?php $my_query = new WP_Query('page_id=39'); ?> <?php while ($my_query->have_posts()) : ...
0
votes
1answer
67 views

Echo a list of all subscriber's user IDs

I'm a complete novice with php. Can anyone let me know the code to simply echo/print a complete list of all user IDs on my site who are 'subscribers' (and not to echo any other user data).
0
votes
1answer
99 views

add anchor tags rel to thumbnails id

Ok, I have a very simple problem. but I'm not good with php, so posting here. the anchor tags of my portfolio items output like this: <a href="http://localhost/dianero/portfolio/kahida/" ...
0
votes
0answers
23 views

WP DB Location for “Next Post to Create” Index Value

I have a malformed DB (no mystery here, I deleted some data directly rather than through the WP admin interface). I've deleted all posts and meta for 400+ but when I create a new post, the sequencing ...
0
votes
0answers
581 views

Get id from database

I need this ID to delete users from table. My plugin crate new table in DB when he is activate. All this code is in main.php, and in second.php i have only form that display my results.. and i include ...
0
votes
1answer
100 views

Issue with WP_Query (need a array of selected ID's)

Today I have <?php $loop = new WP_Query( array( 'post_type' => 'inspirations', 'posts_per_page' => 50 ) ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> ...
0
votes
1answer
61 views

Accessing Post ID Within Loop

I have a page called Products with an ID of '8' Within that, I have the following template part <?php get_template_part('loop', 'feed-products' ); ?> Then within that file, I have this ...
0
votes
1answer
345 views

How to get selected taxonomy or category ID if using custom walker?

I'm building a taxonomy->child taxonomy dropdowns where the child will only be active if the parent is selected. Everything works great, except that I'm using wp_dropdown_categories for the parent ...