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
1answer
24 views

Customising The Admin Bar

I have the following lines of code in my function.php file: // Add a 'Users' navigation link to menu in the admin top nav bar function users_site_menu_link( $wp_admin_bar ) { if( is_admin() || ! ...
0
votes
1answer
28 views

Function not recognizing page id?

I'm trying to setup an if/then statement so that if the page_id is not one of these three pages or their ancestors, then use the default logo. I'm using the is_tree() function in my functions file and ...
0
votes
1answer
49 views

How to echo Widget Title in Custom Frontend-Template Box

I've created a custom Widget with the help of following code: // Creating the widget class wpb_widget extends WP_Widget { function __construct() { parent::__construct( // Base ID of ...
0
votes
1answer
24 views

How do I get thumbnails?

Today I set up my Wordpress blog I used the hueman theme I looked at my posts page And there were blank images with cameras in the middle of them So I guess there thumbnails How do I get them?
1
vote
1answer
379 views

Function to auto-set a featured image that is already in use

I don't even know where to start with figuring this out.... This function for functions.php grabs the first attached image in a post and sets it as the featured image. The problem is that it will not ...
0
votes
0answers
9 views

Default options in a theme form

I purchased a theme that allows to choose the layout options when entering a new article from the backend. There are three options: none, right sidebar and left sidebar. As items are added to my ...
0
votes
1answer
295 views

Custom attributes to javascript tags

My site uses cloudflare but I really want to enable rocket loader, but if I put it on automatic mode, it messes up my whole site... So I googled and found This answer which has helped in terms of ...
2
votes
2answers
239 views

Find first image on paginated post for Pinterest

I've been looking for days, yet can't find a good answer. Perhaps the SE crowd can be of assistance. Any help is much appreciated. I am using a custom-coded pinterest button included on posts that ...
1
vote
2answers
62 views

How to mass-delete inline styles in Wordpress custom post type automatically?

I'm looking for a pragmatic way to delete about 100+ individual pages worth of inline styles. I had entered in content for a client by copying and pasting from Word, which took all that data with it ...
0
votes
2answers
62 views

Count Title and Post Characters

I need to get a total count of characters for post titles and post text characters. Are there any build-in WordPress functions available for that? My posts are paginated so the numbers for post text ...
0
votes
1answer
22 views

ordering and optimizing functions

Ive been hard at work trying to build some functions to display products on my site. The prices for these products are calculated based on many variables. I think the first set of functions work, ...
0
votes
1answer
14 views

Move captions under gallery images in twenty fourteen theme

The new twenty fourteen theme will only show captions on top of gallery thumbs. Is there something I can do in the functions (or copy from twenty ten) to make them visible all the time and show up ...
0
votes
0answers
59 views

WordPress Visual Editor Filter for Visual View

I have setup custom HTML to be created when a user inserts media using "Add Media" in WordPress using the code below: add_filter('get_image_tag', 'add_image_frames', 10, 6); function ...
0
votes
2answers
19 views

Child Theme's Read More Text

I'm sitting here trying to figure out how to change the Read More text. I'm currently creating a Child Theme of Oxygen and as far as I can tell, they don't have a function to easily change it. I want ...
0
votes
0answers
7 views

Redirect all users to previous URL before login, except “contributors”

In one hand I redirect all users to previous URL before login. This is the code: function login_redirect( $redirect_to, $request, $user ){ if(isset($_REQUEST['redirect_to'])){ return ...
0
votes
0answers
9 views

Changing link output of posts

I'm using the X theme & there is a load-content.php file that uses a function to show recent posts & portfolio items. The code is below; I'm trying to make all links go to a specific page ...
0
votes
1answer
16 views

Add Function For Instances of Custom Text in Multiple Category IDs to display in post content

I created an extra content file and inserted custom text for a category (and relevant to that category) to display (on a random basis) in all posts belonging to that category and it is all working ...
0
votes
0answers
15 views

is_tree not working as expected when ending with “else” [closed]

Has anyone run into the problem with the is_tree function - that having an else, it will not work? If I delete the last else statement so that it cannot take on a last variable, it works as expected. ...
4
votes
2answers
436 views

Replacing Icons in the Dashboard

Is there a way for me to replace the icons in the WordPress Dashboard with custom ones? I'm imagining there's got to be a way to do this with the functions.php or, more ideally, with a custom-built ...
1
vote
1answer
435 views

Wordpress function like is_category for subcategory? is_subcategory?

Is there a function in WordPress that will check if the page you are on is a sub-category archive page? Like the way is_category checks if it's a category page?
0
votes
1answer
254 views

Change custom post type slug from plugin options

I'd like to give users the option to change a custom post type slug in my plugin. Using this answer, I'm able to hardcode it into a function: Redeclare/Change Slug of a Plugin's Custom Post Type ...
0
votes
0answers
6 views

What to know all functions fr displaying content for product page [closed]

I am developing a custom ecommerce wordpress theme, and the order the contents are ordered are not like the default of woocommerce plugin. So i want to use my own loop to loop through the details i ...
0
votes
2answers
669 views

Make wp_link_pages() suitable for Twitter Bootstrap markup

Below there's the Wordpress code found in post-template.php for the wp_link_pages() function - this function generates a page navigation for posts or pages having the content split into multiple ...
0
votes
2answers
2k views

redirect wp-login.php to another page

I would like to redirect this page wp-login.php to /login page. So when a user clicks on a link like this <a href="/wp-login.php">login</a>, wordpress will redirect him to /register . I ...
1
vote
1answer
623 views

Using PHP to toggle stylesheet and header image, set in cookie

I haven't done a lot of work with cookies or Wordpress before so I think I've been a bit over-optimistic in my quest :p I have created two themes for my site, night and day. I would like the user to ...
0
votes
0answers
42 views

Media not uploaded in buddypress activity wordpress running on google app engine [closed]

I have deployed wordpress in google app engine. I enabled plugin named buddypress. Everything works fine but uploading media not worked at all. I am not able to upload avatar too. Please help me. ...
0
votes
1answer
31 views

Help with a function in a widget

I'm new to custom widgets and functions, and need a bit of help understanding how to achieve something. On my bookstore site I need to display links to books on external site using their ISBN ...
0
votes
1answer
640 views

Let users upload image(s) to the post from front end

I want to enable logged in users (Wordpress) to submit posts from front end (among with other data). My form is working great, I add custom post meta data which I later display on custom post page. ...
0
votes
0answers
15 views

How to display a custom built field on wordpress default gallery

I created a custom field for the media I can upload on my wordpress website, by adding this code to functions.php: /** * Adding a "Copyright" field to the media uploader $form_fields array */ ...
-2
votes
1answer
21 views

Which action is triggered before final output?

http://codex.wordpress.org/Plugin_API/Action_Reference When I use add_action('init','myfunc'), at that moment the variables (is_404() or other) are not yet detected. When is best time to detect ...
0
votes
0answers
12 views

How to modify Genesis core function?

I am trying to modify a Genesis framework core function. I want to remove strip_shortcodes() from the function get_the_content_limit(). Here is my code: if ( wp_get_theme( 'genesis' ) ) { // replace ...
0
votes
1answer
28 views

How can I customize the size of the header of my theme?

I want to change the size of my header using the Sparkling theme. In functions.php, right below this: /** * Implement the Custom Header feature. */ I added this: add_theme_support( ...
0
votes
0answers
12 views

Increase Comment Author Gravatar Size On WordPress Default Comment Function

I am new to WordPress theme development. I am designing a new theme and using less codes and file as I am starting from basic. I am adding comments and comment form in my single.php using <?php ...
0
votes
1answer
18 views

pluggable function in theme, to be overridden by plugin

Is it possible to add a function in functions.php like this: // ACF if ( !function_exists('get_field') ) { function get_field() { return false; } } and then let ...
0
votes
1answer
590 views

Saving/Writing/Adding file to upload folder

Within a plugin I am generating an image, I would like to save this image to the upload folder and update the WPDB with the location of said file. I cant find any build in wordpress functions to ...
0
votes
2answers
22 views

How to arrange PHP files to allow for multiple types of pages

I am new to WordPress development (the most I've ever done on the web design/development side of things is creating basic HTML sites); so this may be an extremely simple question, but I am trying to ...
0
votes
0answers
15 views

Random text changing to weird icons in both admin & front end

Has any body had this sort of problem before. The text mainly in input field descriptions turns to weird icons see image. I have deactivated all plugins and changed themes several times but same ...
1
vote
2answers
378 views

Using plugin functionality in external php script not working

I am encountering a strange problem which I couldn't solve so far. I'm calling a .php script via cronjob (Debian/GNU Linux). To use wordpress functionailty I added: define('WP_USE_THEMES', false); ...
0
votes
1answer
493 views

Load post attached images on a single page site with fancybox

I'm trying to make a single page site that will display posts as thumbnails in some part. Then if a thumbnail is clicked, I want all the images contained in this post to be loaded with fancybox while ...
1
vote
1answer
313 views

Remote upload file to server B

I'm aware this might be some of the hardest coding to do ever, but thought of giving it a try. Im basically trying to detect all (mp3) filetypes uploaded through the Wordpress media upload and send ...
1
vote
2answers
474 views

Load parent theme files before child theme functions.php

I am creating a theme framework to use in future wordpress themes that I develop. I would like to include dependant files such as classes inside the parent theme before the child theme functions.php ...
2
votes
2answers
3k views

Adding a second email address to a completed order in WooCommerce [closed]

Before I ask this question, I know there is a (legitimate) hesitation to answer questions here about Woo products since they have their own support and their users should be encouraged to use that. I ...
1
vote
1answer
366 views

Auto Populate Custom Field with Complex Value That Increase by One?

Can somebody help me to sort this? I am using WP 3.5.2 and I have "Orders" post type where purchase_order custom field is located. This is the sample of purchase order record: POCOS20130051 PO - ...
0
votes
1answer
12 views

Register a widget area when a theme option has been saved?

Is it possible to register a widget area and sidebars when an option has been selected and saved in a theme options panel? I am using a framework called redux but am not too sure if this can be ...
1
vote
1answer
62 views

php function to display commenter username or login

I want to display the commenters username or login name in a comment template. I know there is a function comment_author_link(), but this displays the "display name publicly as" name and not ...
6
votes
4answers
265 views

Cleaning up WordPress to improve performance?

Looking over the current WordPress codebase it's clear that functions are over-used. My count is over 8,100 functions/methods are defined inside the WordPress codebase. That is terrible, and a ...
0
votes
1answer
13 views

Insert a field with PREG_REPLACE – strange behaviour

I'm trying to insert a custom field (from the Advanced Custom Fields plugin), and I need to place it within a div which I'm wrapping around an img, right before the img-tag. So basically this is the ...
0
votes
2answers
27 views

Display formatted list of taxonomy terms with last seperator different

I am trying to display a list of event producers, which are stored as a taxonomy. For each event (custom post type) there can be anywhere between 1 and many producers, so I would like to list them, ...
0
votes
1answer
18 views

translate the_title() with .po & .mo

i need to translate the_title(). I am using code: <?php _e(the_title()); ?> but not working ... any ideas ?
1
vote
2answers
506 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 ...