The tag has no wiki summary.

learn more… | top users | synonyms

-1
votes
1answer
51 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: ...
1
vote
3answers
2k 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
2answers
142 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
0answers
45 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
2answers
6k views

how to get page id of a page using page slug

Im pretty new to wordpress and I was wondering if I could get a page id with it's slug. Is it possible please let me know.
0
votes
2answers
638 views

get all page IDs from wp_list_pages

I am looking for a way to output all page IDs from the following menu: <?php wp_list_pages('depth=1&exclude='3,5,11')); ?> Only top level pages needed, therefore the 'depth=1'. Any help ...
0
votes
1answer
154 views

How To Show Get Adjacent Posts If Posts Are Sorted By Custom Field

I want to get the ID of adjacent posts. For posts sorted chronologically you can use: get_adjacent_post Are there any standard methods for finding the adjacent post if the posts are sorted by ...
2
votes
1answer
2k views

Get page id by title?

I'm using the following code to insert the content from another wp page into my main home page. Is it possible to make it work with a page title instead of an id number? Eg. Not $page_id = 518 but ...
0
votes
2answers
227 views

Widget to show posts in the sidebar basing on its IDs

I am trying to create a widget that displays posts in the sidebar taking post IDs as input from the user. The result of my code is that the widget displays just the first entered ID and ignores the ...
0
votes
1answer
79 views

User registration add user ID?

I have created a custom user registration template for my WP website, based on this code: http://www.tutorialstag.com/create-custom-wordpress-registration-page.html. Now I was wondering if it is ...
0
votes
1answer
59 views

Are Post IDs Unique Across all Post Types?

I thought Wordpress post IDs were only unique within each post type, so that the first instance of each post type would have an ID of 1 and they would count up from there. In order to get a specific ...
1
vote
1answer
46 views

Transient unique names

What would be the correct way to assign a different name to each transient for each instance of a plugin used as a widget or shortcode?
-1
votes
1answer
2k views

How to get the post's parent ID?

I have a template which outputs the blog posts (Blog Page), I open one of the posts which use single.php template, Now how can I get the ID of it's parent which is the (Blog Page)? I should say that ...
0
votes
0answers
45 views

Create hundreds of users with just ID in phpMyAdmin

I'm trying to do the same as this post. But I have a problem with the insert records into your wp_users table containing all the ID's of the members you want to import Right now, I have 3 ...
0
votes
1answer
75 views

get page id's - not get pages?

I'm trying to do something like this: Hide a page in the admin end without a plugin? However, I don't want to hardcode the page-ids. I want to get the page id's based on template-name. $pages = ...
1
vote
1answer
77 views

Shortcode for a link and thumbnail

<?php // Add Shortcode function blog_shortcode( $atts ) { // Attributes extract( shortcode_atts( array( 'id' => '', ), $atts ) ); // Code if (has_post_thumbnail()) { $url ...
0
votes
1answer
55 views

unused post IDs

Recently I installed plugin called Delete-Revision and noticed that every post has registered few post IDs. I usually use save drafts and update post a few times when I write a post. Here's the ...
1
vote
1answer
285 views

Get author ID with attachment ID

I have a page, outside the loop, that display a media attachment with some basic info about it (title, uploaded date, etc). I have the attachment ID available to me via a form submitted before the ...
5
votes
2answers
970 views

Get page IDs from nav items

I am trying to get all the IDs in my navigation and convert it to a string so that I can use it with wp_query to get the pages that are only listed in the nav. The code to get the IDs: $menu_name = ...
0
votes
1answer
73 views

Why does the page/post ID keep growing when i refresh the post-new.php file?

I created a custom post type and for debugging reasons i display the Post ID on the Add New ... page. If i refresh the page without saving or even creating a new post,(so i just press f5 on the ...
0
votes
1answer
82 views

get post by nav id

I am trying to get the post id by the navigation id to use in a loop. I made a new query to get posts. I am using multiple queries on a page because I need to. one of the queries gets page templates ...
0
votes
1answer
747 views

Display 1 category only with get_the_category (by ID or slug)

After hours of unfruitful Googling, I am asking for your help on this issue. My objective is to display only 1 category with get_the_category if the category ID matches the ID or slug set in the ...
0
votes
2answers
348 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) { ...
0
votes
2answers
124 views

Get a post's ID

How do I get a post's ID? I know I can use the_ID(), but I have to use it in The Loop. How can I get the post's ID without the loop? Because I think using the loop just to find the post's ID will slow ...
0
votes
1answer
361 views

Check is category parent with ids from the childs - get_term_children

I have a hierarchical category list, like: A (Parent Category) - B (Child Category) - C (Child Category) - D (Child Category) B (Parent Category) - E (Child Category) - F (Child Category) ...
0
votes
1answer
72 views

Making posts permalinks consistent numbers

I'm developing a new website, but I can't quite figure out a solution to my permalinks problem. My main website is http://w3spine.com, I'm sending posts to my second WP installation at ...
1
vote
1answer
110 views

How to create a dashboard widget for one user

I will start by warning you that my programming skill is limited. I need to create a dashboard widget that will display in the WP dashboard for the users with the user_id=21. So far I have tried the ...
3
votes
2answers
574 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
2answers
1k views

How to get custom image field of specific post id

I have a page where I'm pulling in content from another post, outside of the loop. I've been successfull at getting the content of the specified post, but I cannot get the image from a custom field ...
0
votes
2answers
134 views

Determine if ID is page or post and query the ID

I want to look up a page id and determine if it's a page or post. Then query that id and display stuff like title, featured image, etc. This works for Pages: query_posts('page=' . ...
0
votes
2answers
223 views

get_all_category_ids for bookmark

I was wondering how to create a list of categories name and ids for Wordpress Bookmarks such as get_all_category_ids for post. I tried using the get_bookmarks, but the category does not appear in it. ...
3
votes
1answer
7k views

get all posts ID from a category

Problem: I need to get an array of ID's of posts from a given category If the category have any posts. This is to be used on a plugin options page. So far I have: $posts = ...
2
votes
2answers
1k views

Creating a Front-end based User Search

I am working on a membership site which requires a front-end user search. I have been searching for an answer like a mad man, and I could really use some help! While there are several plugins that ...
0
votes
1answer
2k 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='. ...
2
votes
2answers
978 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
2answers
188 views

Get custom field from page, in a post?

I'm not quite sure how it works, if you're on a post (single.php), does it count page.php as the page it's on? What i need to do, is get a custom field assigned to a page, from a blog post. I need it ...
1
vote
2answers
223 views

Getting the ID of any image for use in functions.php

I've added two custom fields to attachments on my site, so the user can add a special image credit. I'm trying to write a function that looks to see if either of the custom fields are populated, and ...
1
vote
6answers
9k 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
1answer
49 views

How do I get a array, with the right order of the nested comments?

array (size=10) 'comment 0' => array (size=2) 'comment_id' => string '22' (length=2) 'parent_of' => string '0' (length=1) 'comment 1' => array (size=2) 'comment_id' => ...
1
vote
1answer
260 views

Style category link depending on category ID

I want to style a link depending on its ID, for instance, if the category ID is 2, then I want the link to be pink. My theme calls the category like this: <?php if (in_array('categories', ...
2
votes
4answers
2k views

Custom Walker: how to get ID in function start_lvl

I am making my first custom walker to build an accordion menu. To start with I used this example: http://bitacre.com/2025/custom-nav-menu-walker-for-wordpress-themes There are two functions. First ...
1
vote
1answer
79 views

Can I get the ID of an inserted / linked image?

I am using this code to get the url of first inserted image in a post. Is there any way I can get the ID of that image. global $post, $posts; $first_img = ''; ob_start(); ...
1
vote
1answer
725 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 ...
1
vote
0answers
155 views

Passing the page ID to a login php script

I'm trying to create a simple registration process which goes like this, A visitor clicks on a link (which is viewable only after entering some information such as name, email, phone etc.) This ...
0
votes
1answer
87 views

retrieve the oldest post id

I'm trying to get the ID of the oldest post with the post_type = job_listing and post_status = publish. I'm using the code below but it does not work. Could anyone please help me $oldestID = ...
0
votes
1answer
134 views

Is there a way to show attachment IDs on the attachment info screen?

I want to use attachment IDs for shortcodes, but if the image is published with a permalink, it's harder to find the ID. I've found some functions online that can turn the attachment url into its ID, ...
2
votes
2answers
1k views

Post ID At The End Of Permalink URL Effects Performance (Positively)?

HARD NOTE: This question is solely about performance, and NOT search engine optimization. So, please make sure your answers are as such. W.r.t permalinks, "year" is the most obvious numeric of ...
0
votes
1answer
577 views

orderby not working for query_posts using array of IDs

I have an array of IDs that i send to query_posts to get the posts (which works fine) but it seems to always put the attachment(562) last even though it is the newest. Also tried title and ASC vs DESC ...
0
votes
1answer
234 views

Exclude main blog from get_blogs_of_user

I use WordPress Multisite and in the sidebar i have a box that shows a list of blogs the logged in user is a member of. I'm looking for a way to exclude the mainblog from this list. The main blog ID ...
-2
votes
1answer
382 views

How to define category ID in an array?

I have the following: <?php if ( array( 'is_category', 'is_tag' ) ) { ?> What I want to do is (that doesn't quite work): <?php if ( array( 'is_category('13')', 'is_tag' ) ) { ?> So ...