Questions tagged [functions]

A function is a sequence of program instructions that perform a specific task. It is packaged as a unit that can be used wherever the according task should be performed.

Filter by
Sorted by
Tagged with
2 votes
1 answer
676 views

Set user loggin status?

I create user with wp_create_user,after succesfully creating a user I need to set his status to be logged in?How to set his status to be logged in ?
user avatar
  • 802
1 vote
1 answer
1k views

How to pass data from page to widget functions?

I need help,need to pass data from page,to widget function,I need to pass author id to widget,any idea? Tnx
user avatar
  • 802
9 votes
8 answers
42k views

Include files in child theme functions file

Typically in my theme function file I'll require other files to keep things neat. require_once("foo.php"); Now working in a child theme I'd like to do that same. I'm adding custom admin options and ...
user avatar
  • 2,581
0 votes
1 answer
370 views

Get urls of images in a gallery?

I need to retrieve the URLs for the images inside a gallery, what's the appropriate SQL query for this, based on the post ID? I currently have something like the following which I found on via ...
user avatar
  • 115
2 votes
1 answer
112 views

Should everything in functions.php be hooked or filtered?

Considering how often functions.php is called, shouldn't all of its contents be hooked or filtered into core WP functions like init?
user avatar
  • 1,725
2 votes
3 answers
676 views

Link Category Description

I'm pulling my hair out over this. In the Links manager, you can enter a description for the category (in addition to the link itself). However, in wp_list_bookmarks, there is no way to call this ...
user avatar
  • 3,047
1 vote
1 answer
935 views

How often is functions.php loaded?

Trying to get my head round functions.php and am wondering how often it is loaded?
user avatar
  • 1,725
4 votes
2 answers
3k views

Enabling Sessions in WordPress 3.0

Im using a wfcart in my WordPress site but for some reason on certain pages WordPress drops the session I'm wondering if there is a way to enable sessions in WordPress 3?
user avatar
2 votes
1 answer
3k views

Help extending custom drag-drop page ordering on admin page list screen

I am utilizing the following code which transforms any hierarchical page or custom post type with the ability to reorder the the pages through simple drag/drop. (also this code also adds a new display ...
user avatar
6 votes
2 answers
4k views

How to add a custom metabox to the Menu Management admin screen?

Although I am very thankful to the wordpress core team that they have finally integrated native menu management capabilities I get frustrated with some key elements which I would like to change. I ...
user avatar
0 votes
1 answer
153 views

Defining the value of a variable before a function?

I'm trying to edit a plugin so that it only shows it's submenu if the user is an administrator but I don't know how to define the value of the variable before the function: function load_view( $name, ...
user avatar
  • 1,297
0 votes
3 answers
2k views

Removing Unnecessary Text from Admin Menu without CSS

I am looking for a way to remove all the unessesary text from default worpdress metaboxes. Preferably I would like to ensure that the content is not just hidden through CSS but actually removed from ...
user avatar
1 vote
1 answer
119 views

How to display html in only the first level of WP comments?

How would I display html code in only the first level of threaded comments? Example L1 Comment ----L2 Comment --------L3 Comment L1 Comment I have a piece of html code that contains basically reads "...
user avatar
  • 3,440
3 votes
1 answer
6k views

register_post_type for Pages?

Been reading this site and Wordpress Codex and I see there is a function to enable custom type of pages in Wordpress. How can I do the same to enable for Pages ? Or at least get the options for the ...
user avatar
  • 223
1 vote
2 answers
1k views

Using Default WordPress Custom Header Image Crop Feature in a Post Type / MetaBox

I am not sure how many of you have experimented with the new custom header image functionality of wordpress 3.0 but its actually very cool (enabled by adding the function to your functions.php file). ...
user avatar
7 votes
4 answers
7k views

Removing Metabox for "Slug" without removing functionality

Here is an interesting question. I have recently noticed that if you utilize the code remove_meta_box('slugdiv', 'post', 'normal'); you are actually unable to modify the slug when you click on the ...
user avatar
344 votes
108 answers
165k views

Best collection of code for your 'functions.php' file [closed]

As with many others who are now viewing this post, I have been reading various blogs, forums, and discussion groups to learn and improve my WordPress skills. Over the past 12 months I have been on a ...

1
108 109 110 111
112