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.

learn more… | top users | synonyms (2)

2
votes
1answer
2k views

How can I tell if I'm on a login page?

There are functions for is_home(), is_blog() is_single() etc... What's the best way to tell if I'm on a page that is requesting that I login? I guess that would just be the wp-login.php page.
1
vote
1answer
32 views

Which file of wordpress manage plugins functionalities?

Which file of wordpress manage the plugins functionalities. For example if a have to insert another rule in a plugin functionality where i go to modify?
0
votes
1answer
42 views

How to know when an user is loged in?

Hello i have this simple problem: when the user is logged an podcast player is shown, other case no. How verify when the user is logged? Im wordpress and php newbie. Thankx
0
votes
1answer
151 views

Do I Need to Prefix Variables Inside Functions?

Sorry, this is a noob question. But, I want to follow the best practices. I read that functions and global variables should be prefixed in plugins. So, for example, myfunction(), should be ...
3
votes
1answer
4k views

How to override function in functions.php of parent theme?

I have created child of theme twentyten. I tried to override function written below /** * Returns a "Continue Reading" link for excerpts * * @since Twenty Ten 1.0 * @return string "Continue ...
0
votes
1answer
401 views

Change default comments form title [duplicate]

Possible Duplicate: Change comments form title on a page by page basis I'm looking to change the comments form title (my theme defaults this to "Leave a Comment" or "Leave a reply to"). I ...
0
votes
1answer
71 views

Removing the custom_image_header from wp_head

I am looking to remove the custom_image_header from the wp_head. I would like to use this in a more manual way throughout my theme. I understand the general approach for this is to include CSS in the ...
0
votes
1answer
788 views

functions.php and conditional tags

I'm having the following issue: some conditional tags do not work on the functions.php file. For example I'm trying to do the following: if ( is_home() ) : wp_enqueue_script('accordeon_setup', ...
0
votes
1answer
2k views

overwrite a plugin function in functions.php

need to customise a plugin function but would rather not edit the plugin itself so updates wont remove the custom changes. function iss in a class called UserAccessManager and the function is; ...
0
votes
2answers
309 views

Fix My Custom Function: Remove Automatic <p>

I want to remove the automatic paragraph tag that goes around my excerpts, which are being outputted by a custom function. I'd really appreciate if you could tell me what to add to my code. I'm ...
16
votes
1answer
11k views

How to override parent functions in child themes?

I've been reading around and trying to figure out how to do this, but for some reason I can't seem to override parent functions in my child theme. I'm using TwentyTen as a parent - can anyone tell me ...
0
votes
1answer
3k views

get_term_by not working when in functions.php

I have an odd issue with get_term_by(). It's working fine when I use it inside a template, but when I use it in functions.php it just returns false. $term = get_term_by('slug', 'some-term', ...
0
votes
1answer
156 views

How do I create pages within a Wordpress post?

I run a music blog and I want to do a countdown of our top 50 tracks of 2011 so far. There's no way that I want to add 50+ images and Audio Players into just one post, and I don't want to break the ...
0
votes
1answer
123 views

Code in custom widget queries all posts, when it should only query the current post

I have a query in a custom widget (my first one!) which, if it's of custom post type book, retrieves the post ID. This then gets used in a WP_QUERY to retrieve data about the page. This works ...
0
votes
1answer
41 views

Isn't the way posts are displayed very unefficient?

I'm pretty much a WP newbie, and I've noticed that in a lot of themes, there is the exact same code for displaying posts in three different places (single.php, archive.php, index.php etc) This just ...
1
vote
2answers
3k views

Best way to pass arguments to another page in Wordpress

What is the best way to pass arguments to another page in wordpress. I did it this way : <a href="get_permalinka(id_of_page).'/&i=2&j=3&k=4'">Link/a> I get this arguments with ...
4
votes
1answer
595 views

Can I turn off write-in tags/taxonomies?

One of the big problems my site staff has had with tags is the overwhelming number of similar or duplicate tags, due to the write-in ability. I'm about to add new custom taxonomies to my site for ...
1
vote
1answer
9k views

Override plugin with functions.php

add_action('wp_head','add_gpp_gallery'); function add_gpp_gallery() { if( ( is_single() || is_page() ) && ( !is_page_template('page-blog.php') ) ){ remove_shortcode('gallery', ...
1
vote
4answers
2k views

wrong php date()?

hey guys, it's weird and I've never experienced that before. I've created a new blog and a custom theme. I'm using <?php echo date("H:i"); ?>in my theme. The time that's put is 2h earlier. ...
1
vote
1answer
151 views

Help with Wordpress Query

I'm sort of a noob when it comes to Wordpess; I've only recently started building themes and I've run into a wall. I'm trying to feature 3 different articles at the top of my site using wpquery and ...
1
vote
1answer
67 views

How to validate this deprecated function

I want to validate this deprecated function: add_filter('user_has_cap', array(&$this, 'filter_user_has_cap'), 10, 3); It needs to use roles or capatibilies, so I guess 10 is the admin level, so ...
0
votes
1answer
161 views

How to change a meta value (of a published post) after X days.?

I have a custom field. I would like to change the text of that custom field after x days. I want something like this: if ( published post is more than 90 days old ) { echo "your post is more ...
0
votes
1answer
175 views

Latest Foursquare Checkin function

Does anyone know how to display the latest Foursquare checkin for a specific account on a WordPress blog? Ideally I would like to add the function to the theme rather than use a plugin but i'm open ...
2
votes
1answer
822 views

If function exists, and array is met, echo function?

I have a function like the following: <?php echo my_custom_function( array( 'category_url'=>'My Special Category' ) ); ?> It pulls data from the "My Special Category" and displays it. I ...
0
votes
1answer
1k views

Error after editing functions.php

I was making minor changes to functions.php file but just as I made the changes I got an error, I used FileZilla and undo the function I added but now I am getting the following error, Fatal ...
1
vote
1answer
251 views

Using $themename Variables

Is it a bad idea to set your themename and shortname as variables to be used in the various functions of a theme? Example: $themename = mytheme; $shortname = mth; /** * Get our wp_nav_menu() ...
0
votes
1answer
258 views

Functions.php error - when trying to change the theme

After trying to replace the wordpress theme , it says that the functions.php file in the theme catalogue - the last line - is not ok Parse error: syntax error, unexpected $end in ... ...
0
votes
1answer
801 views

Where to call my pagination function?

I have just been following this tutorial - http://www.lateralcode.com/wordpress-pagination/ I have written that function in my functions.php file and taken numerous notes on how it works. The ...
0
votes
1answer
229 views

How to list posts from a plugin taxonomy?

I would like to query posts from a taxonomy created by a plugin (WP Business Directory Manager). How would I do this? I want the query to create html listing of the posts and allow me to list a ...
1
vote
1answer
3k views

Edit the_content function

I want to edit the default function the_content(). I know i can add_filter('the_content', 'with_my_function') but im having trouble outputting the old content with mine. Heres an example of what im ...
1
vote
1answer
5k views

img width and height attributes being set by get_the_post_thumbnail

I'm working on a custom theme that I've inherited to maintain. At the top of the homepage there is a header area with some images generated by get_the_post_thumbnail. The call to ...
0
votes
1answer
48 views

How *not* to show the last post on the latest posts list

An image speaks for a thousand words so please bear with me: http://interativo.modateca-sc.com/ The last post appears twice. Once as the feature post and then again on the "main blog part" where the ...
0
votes
1answer
247 views

Problem with custom function from jQuery slider tutorial

I found the perfect slider for my needs, the only issue now that is that I cannot get it to work correctly. Problem that occur is that the function created doesn't work like it should. It ought to ...
0
votes
1answer
414 views

Need To Resize Images Exactly Without Losing Image Details

I am working on a Wordpress site that heavily uses image uploading and whatnot, I have defined the image sizes in my functions.php and I have hard crop mode turned on which ensures that my images are ...
0
votes
3answers
481 views

Dropline menus — seperators between children only?

I'm working on a custom dropline menu using wp_nav_menu. Using wp_nav_menu( array( 'theme_location' => 'primary', 'after' => '|' ) );, I can put separators after every item. However, I'm only ...
1
vote
5answers
340 views

Problems with removing admin bar

I am trying to remove the admin bar from a theme front end of a theme. I found the following code block: add_filter( 'show_admin_bar', '__return_false' ); remove_action( 'personal_options', ...
1
vote
1answer
1k views

comments_popup_link without echo?

I would like to just get the HTML that comments_popup_link generates, and echo it later on. I don't see the comments_popup_link has an $echo parameter, and I don't see a get_comments_popup_link ...
2
votes
1answer
640 views

When to check if a function exists

I've just started developing a WP plugin, and i've been reading some code from other plugins as a way to get started. I've seen a couple of plugins that wrap all or some of their functions in the ...
0
votes
2answers
857 views

List of Body Classes Generated by body_class()

Does anyone know where I can get a list of all the body classes generated by body_class() for every sections and every conditions, including custom post-types, etc.? For example, for a search result ...
1
vote
1answer
300 views

Remove adjacent_posts_rel_link under 3.2?

I'm trying to remove the adjacent_posts_rel_link links under WP3.2, i.e. remove these from wp_head: <link rel='prev' title='blah blah' href='http://...' /> <link rel='next' title='blah blah' ...
3
votes
1answer
4k views

Wordpress Enqueue for homepage only, functions.php, wp-framework

I'd like to replace my: if(is_home()) { wp_enqueue_script( 'homestuff', get_theme_part( THEME_JS . '/home.js' ), array( 'jquery' ), null, true ); wp_enqueue_script( ...
2
votes
2answers
375 views

Cleaner way to access custom fields in code?

I have 15 custom fields that I use to generate reviews for my site. Currently I access each field like this: //Buy or rent, type home, price if ( get_post_meta(get_the_ID(), ...
0
votes
1answer
444 views

display public excerpt for private post

Thank you in advanced. I know there are plugins that can do this, but I am looking for a simple solution for my function file. I would like to display the excerpt for all posts with the more tag for ...
0
votes
1answer
629 views

create function to call category name and slug

In several theme templates I have code to retrieve the category name and slug for the present post or category page. It is outside the loop. Here is the repeated code: global $post; $categories = ...
3
votes
2answers
2k views

How do I remove a require_once admin panel from the parent theme from the child theme functions.php?

In the parent theme, the following is at the bottom of the functions.php file. require_once(TEMPLATEPATH . '/admin/admin-menu.php'); In the child theme's function.php, this code will include the ...
0
votes
2answers
1k views

Different size video display for category page (smaller) & detail page (larger)

I have a 'media' category page that pumps in videos / image galleries. I'm looking to have a smaller size video display (vimeo / youtube) on the category page, and the full size video on the single ...
2
votes
2answers
108 views

WP disobeys disabling of the posts revision feature

I disabled the posts revision feature according to this codex by placing this code in the wp-config.php: define('WP_POST_REVISIONS', false ); But revions are still being saved by the WP. Why? I am ...
0
votes
1answer
778 views

Help with Wordpress function inside a shortcode

I'm trying to spice up a theme of mine with some shortcode buttons but I'm having quite a bit of trouble when trying to call the author's name within the button itself. I tried simply including ...
0
votes
2answers
1k views

Remove image from post_content on save_post

I'm trying to setup a function in functions.php that removes an image from the post_content on save. Everything works up until the time I'm trying to save the content, the page just hangs and I get a ...
1
vote
1answer
189 views

Adding Google Analytics to footer selectively

// add google analytics to footer function add_google_analytics() { ?> if ( !is_user_logged_in() ) { <!--Google Analytics--> <script type="text/javascript"> var ...