The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
2answers
453 views

get the_title_attribute by id

I'm creating a list with a few permalinks which I call to with <a href="<?php echo get_permalink($id); ?>" title=".... And for the title I want to call the_title_attribute(). But it seems it ...
0
votes
1answer
325 views

Compare “Main” post ID to ID inside wp_query loop

I have a video viewing section on my site. The single post template displays a large area where the video plays and then there's a column of thumbnails representing other videos along the right side. ...
-3
votes
2answers
103 views

Query parsing only author ids

I need array only all author ids from the loop, each one only once if possible and out of all posts in the loop. Any suggestions?
0
votes
1answer
158 views

$post->ID displays wrong ID

This one is pretty weird. This code: $post->ID Displays right ID every time excepting the blog page (the page set as blog on /wp-admin/options-reading.php). On that page $post->ID returns the ...
0
votes
1answer
75 views

get id custom tables on current page

i will get id on current page. <?php $hasil = $wpdb->get_results("SELECT id,bab,tema FROM $tabel ORDER BY bab ASC"); foreach ($hasil as $bab) : ?> <tr> ...
1
vote
1answer
107 views

How to call widget by widget's id?

Is it possible to call widgets using it's id? for example I have a sidebar. In this sidebar I put meta widget and tag cloud widget. I have got their id's ($widgets_list): 'meta-2' and 'tag_cloud-2'. ...
0
votes
1answer
531 views

post_author for wp_insert_attachment

I am working on a custom theme, in which I need to programmatically inserts posts and attachments. One requirement is those posts belong to users that are not the user who is logged in and running ...
2
votes
2answers
991 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
0answers
57 views

Using array page name together with page id to deregister script

If I use this: if (is_page(array(blabla-test-page, 20726, 20720, 38881))) {wp_deregister_script( 'gdsr_script' ); } the blabla-test-page looks like it overrides different pages, even if certain ...
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
1answer
29 views

Using class id from array for query

I'm using Event Calendar 3. Since there seems to be no easy way of querying all upcoming events as posts, I tried it this way, getting the IDs from the DB and querying the posts from that: <?php ...
0
votes
2answers
218 views

Function to grab specific image IDs from media library.

I want to grab images 161 thru 166 without having to calling my entire media library array and having to splice those up. In time, the more I have in there the more it's going to slow my site down. ...
0
votes
2answers
353 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) { ...
-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: ...
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='. ...
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
3answers
797 views

How to get post ID with hooks publish_post, new_to_publish, etc

I have two plugins, one uses the function wp_insert_post(), the other has a code like this: add_action('future_to_publish', 'myFunc', 10, 1); add_action('new_to_publish', 'myFunc', 10, 1); ...
0
votes
1answer
155 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 ...
0
votes
2answers
664 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 ...
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
230 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
80 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
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
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
47 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
77 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 = ...
5
votes
2answers
1k 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
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
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 ...
1
vote
1answer
297 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 ...
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
84 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 ...
1
vote
1answer
262 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', ...
0
votes
1answer
238 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 ...
0
votes
1answer
363 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
2answers
127 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
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 ...
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 ...
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
231 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. ...
4
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
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
225 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 ...
0
votes
1answer
3k views

Display posts from an array of ID's

The result of the query so far is the print of the array, Array ( [0] => 309 [1] => 10 ), 309 & 10 are the correct id's of the posts I want to display, and "No posts were found" the result of ...
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' => ...
0
votes
4answers
933 views

How can I receive the image id using the media box?

The code below allows me to retrieve the image string, when Insert to Post has been pressed, but what would be the correct way to retrieve the ID of the image? So I can retrieve all information ...