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)

0
votes
2answers
525 views

How do I redirect upon login a specific user based on role?

I'd like to force a user to a specific page upon login based on their role using if ( current_user_can('contributor') ) and the main login function function wp_loginout($redirect = '', $echo = ...
-5
votes
0answers
31 views

I Can't Conect To My Wordpress Website! [closed]

I have the website [domain removed] When I try to conect from [domain removed]/wp-admin I am redirectioned to another website. WTF? All I done previously was to change a little bit of code in my ...
0
votes
2answers
23 views

Is `is_sidebar_active()` deprecated, and showing error?

I Googled is_sidebar_active(), used by several WordPress trainer, but I came to the decision, the function's surely deprecated. But unfortunately I found no mention, even no entry in WordPress Codex. ...
0
votes
1answer
118 views

Adding class to last list item? Not WP generated

this one has been getting me for a while. At the moment I have a repeater field with Advanced Custom Fields: <ul id="servicelist" class="clearfix"> <?php if(get_field('homepage_service')): ...
0
votes
1answer
25 views

How Can I add a menu to the theme from withen the function.php file

I have the following code I'm trying to automatically add a menu to a theme via overriding a function. So I won't have to edit the theme file However the menu is being outputted at the top of the ...
0
votes
1answer
70 views

Adding tables to the WordPress Editor

I tried this fix: http://www.paulund.co.uk/display-full-tinymce-editor-in-wordpress But I see no change in my editor. So how do I enable tables in the wordpress editor. MY function is: function ...
0
votes
2answers
31 views

making php value numeric

I used some of this code from this page on Stack Overflow: Using wp_query is it possible to orderby taxonomy? It's about the function to be able to sort a query by a taxonomy value. Although it works ...
0
votes
1answer
14 views

Automatically add author's name to post_tag

I need to add the author of a post's name to the post's tags whenever the post is published. So for example John Smith wrote a post, the tag 'John Smith' would be added to that post's tags. I've ...
1
vote
1answer
20 views

Make WordPress size and name images for Retina.js

I'm a huge fan of the way retina.js works for high pixel density displays. Essentially, when it's loading image assets (via <img> or css image) it will check if there's a @2x suffix version of ...
0
votes
1answer
15 views

How to access function from outside of a class within this class in WP plugin?

I am developing a WP plugin called e.g. DD_Awesome_Plugin and this is my code so far (simplified version without additional code logic within class functions): class DD_Awesome_PLugin { public ...
1
vote
1answer
256 views

Update user meta of author when post content is viewed

I have a value that I'm trying to store as user meta for authors on my site. I need it to update itself every time the content of a post is viewed for that author. Here's as far as I've gotten but it ...
0
votes
1answer
31 views

How Do I include/Import a Custom Widget from the Parent theme into My Child Theme?

I'm trying to make a small modification to a custom widget that was included with a clients parent theme. Whenever I remove the parents version of the widget (for testing purposes) the child version ...
0
votes
1answer
26 views

Hourly Routine Not Firing ( wp_schedule_event() )

This is a practically copy/pasted version of the hourly wp_schedule_event example taken from the .org site. Its not moving...and I know I have visitors to "trigger" it. Its kind of a pain to wait an ...
0
votes
1answer
14 views

Wordpress Theme Update Action?

I've done quite a bit of searching. I'm looking for hook/action called after a theme update. I know the initialization one - but a basic update? Cannot seem to find. If one does not exist, how can ...
-1
votes
1answer
18 views

Ajax calls in wordpress

I want to send a ajax request in wordpress which tracks my clicks. For now i have added this in my functions file : add_action('init', 'my_script_enqueuer'); function my_script_enqueuer() { ...
0
votes
1answer
27 views

WordPress Check User Role Function (multiple roles)?

I'm playing around with the check_user_role function put together by AppThemes; as mentioned in the WordPress current_user_can codex page. In the AppThemes tutorial code it references the following: ...
0
votes
1answer
684 views

WooCommerce - Want to show multiple currency for a single product

Am using woocommerce - and want to show multiple currency for a single product. I know there is a currency converter widget extension. But am not able to buy it for now. So if can some one assist me ...
-1
votes
0answers
19 views

How to add custom jquery to wordpress? [closed]

At my woocommerce site site im getting syntax errors, when im trying to add a custom function, so i must have implemented the function wrong. The code sample below is my functions.php file, where i ...
0
votes
1answer
161 views

The work of Wordpress Function update_post

I use wp_update_post() in a Frontend Page. The first part of the function works as expected. post_content and/or post_title will be changed in wp_posts. But the function does not create a revision ...
0
votes
1answer
12 views

first instantiated SimplePie object cosumes 5mb?

This following lines causes 5mb memory consumption. It appears large to me. if ( ! class_exists( 'SimplePie' ) ) include_once( ABSPATH . WPINC . '/class-feed.php' ); new SimplePie(); ...
1
vote
1answer
169 views

Remove bulk actions based on user role or capabilities

How can I remove the "bulk actions" based on user roles or capabilities. Actually I have this code to do the job, but now I need to exclude the site admin, I need to let the administrator to access ...
0
votes
1answer
591 views

Adding Shortcode to Text Widget

At the moment, I'm running WordPress v3.2.2 (soon to upgrade to v3.4.2), and am trying to insert shortcode to insert Issuu into a text widget on our sidebar. The WordPress plugin I installed and am ...
-2
votes
0answers
21 views

How can I create a simple/editable window/area on my homepage? [closed]

I have been on more than 4 wordpress theme/plugin related forums to try and find a solution for my request. I am building a jumbo mortgage website with WordPress. I need an ultra simple homepage ...
0
votes
1answer
20 views

Adding Categories Through Function

I am creating a template theme for WP and am wondering if there is a way of the theme adding new categories to the db, through the functions.php upon activation of the theme. It seems like a fairly ...
0
votes
1answer
206 views

Wordpress - Selectbox in admin panel function linking to CSS

So what I want to do is link the selectbox to my CSS. Like if i click an item on the list that the background of my header will change, the header's color is in the CSS. The selectbox isn't in the ...
1
vote
1answer
23 views

Force authors to Preview a post before publishing

I'm looking to find a way to force authors (including admin & editors) to preview their post before publishing. Is this possible, if so does anyone know the easiest way to achieve this? I'm ...
0
votes
1answer
133 views

Replace & with &amp;

I have a plugin that unfortunately I have no control over, the problem I am experiencing is that it doesn't use &amp; in place of & and so breaks the sites validation. Is there a function I ...
0
votes
2answers
26 views

Show image exactly defined to a width

I have a photoblog displaying posts as image galleries having width 500px and some posts as single image of width 900px. For posts with 900px width images, I made category HQ. Posts with 500px width ...
0
votes
1answer
13 views

One button to change all settings in theme customizer?

I have been attempting to create a theme reset button for the theme customizer that automatically removes all of the theme_mod settings. I have tried multiple ways to do this and have never been able ...
0
votes
0answers
7 views

Extended image control not showing up in theme customizer

I have an extended image control for the theme customizer that adds in an extra panel and lists images I have hardcoded into the extended control. Now the issue is that it is not showing up in the ...
0
votes
1answer
24 views

How to return hook data when multiple parameters are present?

What is the proper way of returning data to a hook when there is more than one parameter present? Example apply_filters('image_downsize', false, $attachment->ID, $size) Attaching a callback ...
0
votes
0answers
21 views

How to get dynamic data in page hierarchy?

I'm trying to mimic the page hierarchy rules of WP. I'm checking for the existence of certain files, then requiring them if they exist -- in the same order as I understand the hierarchy rules. Here's ...
0
votes
1answer
299 views

How to set the default avatar of buddypress avatar

I need a way to set the default avatar for buddypress's bp_core_fetch_avatar. Using the regular get_avatar you can just set the $default path but I can't find anyway to do it with buddypress's ...
1
vote
2answers
39 views

How to remove the cufon script from Dzonia Lite theme [closed]

I am using Dzonia Lite theme in my website. When I try to remove the cufon script from my functions.php file the sliders that were present in the website are not working. Colud anyone suggest me how ...
0
votes
0answers
11 views

How to utilize theme customizer live preview in this situation?

Short version: I am using the theme customizer in my theme and javascript for the live preview. I am not sure how to implement the javascript for php(as seen in code excerpt). I am creating a theme ...
0
votes
0answers
19 views

How to disable controls in theme customizer?

Edit: I have rewritten the question in hopes I will get a reply from someone who knows the theme customizer. I am trying to figure out how to disable setting controls in the Wordpress theme ...
11
votes
2answers
557 views

How to make a image-size selected by default in Media upload - WP v3.5

Bare with me. I want to have a custom image size selected by default in the Media upload popup page. In Wordpress v3.4.2 and prior, this elegant code worked fine: function ...
0
votes
1answer
142 views

functions.php not working after moving

I just migrated my site from localhost to live server. But it seems like a new installation, my custom post types, taxonomies are not there. The pages and posts i had are still present. ...
1
vote
1answer
20 views

Change position of media in admin menu

Is it possible to set the position of an item in the admin menu? I'm trying to move the media link under my custom post types. I know that the media link is position 10. Is it possible to set it to ...
1
vote
2answers
30 views

How to remove the excerpt in the Dzonia Lite theme

I am using Dzonia Lite theme in my website. My front page shows all the latest posts. I am getting an excerpt at the end of each post. Could anyone suggest me how to remove that excerpt at the end ...
0
votes
1answer
227 views

Add Login and logout buttons to top menu bar

I got this code to insert menu bar in the PRIMARY menubar, but I can not find a way to insert it into my secondary, or top menubar above the primary menu bar. Could anyone teach me how to do that? ...
0
votes
0answers
11 views

Disabling a plugin when logged in as admin [duplicate]

Is there any way to disable a specific plugin when logged in as the administrator? Currently I'm using a plugin called Wp-Minify and I would love to be able to have the ability to pause it when I'm ...
0
votes
0answers
15 views

Dynamic Custom Menus [closed]

I've created a meta box so my client can choose which custom menus to use on certain pages. That seems to be working fine. However, I've created a second menu but only the original menu is showing up ...
0
votes
0answers
15 views

WordPress Popularity Score relative to all posts (score views, shares and comments)

I am trying to find a solution to score my posts in an effort to visually represent how "hot" they are, relative to other posts, or relative to a score of 1. I have views, total shares and comments ...
0
votes
1answer
137 views

Changing post category from dropdown

I am showing a list of posts on the front of my wordpress site which each have a dropdown next to them with a list of category's, which are pulled in as follows. As you can see the form submit button ...
1
vote
2answers
184 views

Custom gallery in wp3.5

I used a tutorial I found for a slick little custom gallery in 3.4, but upon upgrade to 3.5 it no longer works. I'm trying to learn php still and can't seem to get this working again, as I either get ...
0
votes
2answers
129 views

can you set a default value to a custom field

I'm looking to set a default value to a specific custom field, in case the client doesn't add into the custom field it already has a specific number associated with it. one step deeper, I'd like it ...
0
votes
0answers
23 views

Run function from parent on child site

I'm running a Multisite wordpress installation and have a couple of child sites. Im trying to run a script from the main page on one of the child sites. It can be a shortcode [pro_display_zone ...
0
votes
2answers
27 views

How do I call a function to use on a page?

I want to be able to use a function called DisplayAverageRating for each of all the posts I list on a page. The function can be found here: http://pastebin.com/iXym00QM How am I supposed to call it ...
0
votes
0answers
44 views

How to Display Sequential Post Number Count

I know this has been answered at least a couple of times already and there is an answer out there from alchymyth2010 but I am looking for a different solution if possible because I have a fairly big ...

1 2 3 4 5 25