The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
26 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
12 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
29 views

Using get_term_by to get tag id

I want to get posts that do not have a certain tag. I am having trouble retrieving the tag-id. The term id comes up as 0. Here is my code: $tag_name = 'my-sticky'; $tag = get_term_by( 'name', ...
0
votes
1answer
34 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
34 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
24 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
49 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
11 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
25 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
23 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
75 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
0answers
49 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 ...
0
votes
2answers
61 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
71 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
20 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
42 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
27 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
26 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
18 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
43 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
38 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
676 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
100 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
38 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
0answers
36 views

How to avoid comment form outputting user id

I have a comment form on a website and here is the code for outputting comments: <ol class="comment-list"> <?php $arg = array( 'number' => 10, ...
0
votes
1answer
64 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
18 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
208 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
0answers
81 views

Getting post ID and inserting it to the database field

I have this code that processes an entry into a Wordpress database, I would like to pick the POST_ID of the page where the item is processed and sort it alongside the time stamp that the page was ...
0
votes
1answer
63 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
35 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
237 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 ...
5
votes
4answers
365 views

Are post ID's reliable?

I understand that post ID's are unique, but are they reliable as persistent data ID's? More specifically, is there a guarantee that, through a migration or another data exchange, post ID's will not ...
0
votes
1answer
229 views

how to get the post id in plugin

I have a plugin that I'm working on and I'm having trouble getting the post id so jquery can use it. I'm able to get it using the admin_head hook but I'm not sure how I can return it to jquery. I'm ...
1
vote
1answer
122 views

Make slug as ID Number for custom post types

I want to make the slug for each of my custom post types to be the post ID number. How do I do this? None of my posts accept post title, content, or anything else - they require different data which ...
0
votes
1answer
38 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
19 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
79 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
118 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
61 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
216 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
216 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
73 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
3answers
40 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 ...
1
vote
1answer
670 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
3answers
1k 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. ...
1
vote
0answers
155 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
133 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
45 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 ...
1
vote
2answers
409 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 ...