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
19 views

How do you publish a draft on Wordpress

I can't work out how to publish a draft. I go to preview, to check everything's ok, and then there doesn't seem to be any option to do anything more.
0
votes
1answer
51 views

Getting rid of the blog page entirely

My goal is to not use a separate blog page but end up with a structure like this... http://domain.tld/page/comments/ I believe I can do this with the Cornerstone plugin ~ [ ...
0
votes
1answer
28 views

the_post_thumbnail issues

I am trying to make the thumbnail for each post display on the homepage of a site for a client; although the thumbnails do display, they're not being displayed inside of a specified "thumbnail" div ...
2
votes
1answer
42 views

How can one utilize a variable as a callback function name for add_settings_field

I'm trying to cut down on the amount of code that is in my theme options function. I'm adding my settings like so: add_settings_field($k,$v,$callback,$the_options,$the_group,$args); This works for ...
0
votes
2answers
81 views

Show last 5 posts from specific category

I'm trying to show the last 5 posts from a specific category, which will be linked to a function so i can insert the shortcode in a Wordpress page. The code i have is as below, it does everything i ...
-1
votes
1answer
34 views

Using Schema with `the_excerpt`

I'm currently developing a WordPress site and want to use Schema, I have been some what successful so far but have now hit a stone wall. I want to use: itemprop="description" to the ...
0
votes
0answers
25 views

How can i Solve this [closed]

Fatal error: Call to undefined function define() in /home/myclasi1/public_html/images/index.php on line 14 How Can i solve this ? I've search a bit on the internet and some guys said that i should ...
0
votes
0answers
47 views

How to execute a function from function.php in a javascript?

I have created a custom menu function in functions.php, but I need to execute it in a container that is created by a javascript. Is this doable? The js is outputting a container called ...
0
votes
1answer
34 views

Function Reference for custom link in Admin Menu Management Page

What is the function reference for the text within the URL field in the Admin Menu page? I have a PHP function that is utilizing the_content function reference to look for specific file paths and ...
0
votes
3answers
2k views

Unhook jQuery from WooCommerce via `functions.php`?

So I am using the http://woothemes.com/woocommerce/ plugin for eCommerce and it's registering jQuery local and conflicting with my default jQuery call from Google CDN. It took a long time but I ...
2
votes
2answers
115 views

javaScript in <head> section of WP API

How do I place the following javaScript in the <head> section of the Wordpress Widgets API menu screen? <script type="text/javascript"> jQuery(window).load(function() { ...
0
votes
2answers
28 views

Using Output from one Function and calling it into another

I'm trying to get my head around a fairly simple concept in PHP but I'm pretty green. I have a function.. function pa_insertPage($atts, $content = null) { // Default output if no pageid given ...
0
votes
0answers
66 views

Adding a check box and a link to terms and conditions on registration page?

I found this code online, but it's for the login page. I tried changing the word "login" to register and noticed that it appeared on the registration page; however it didn't need to be checked off to ...
0
votes
1answer
59 views

Custom Function for SEO by Yoast plugin

We use a very customized version of WordPress for some of our index/root site pages where we use a custom meta box for custom permalinks. What we are looking for is a custom function that basically ...
0
votes
1answer
28 views

Generate daily archive whenever any post type is added

We have an issue with our date archive in WordPress, where our daily archive (example address www.xxx.com/2013/01/09) is only generated when a post from the default post type is added. Any day where a ...
0
votes
1answer
48 views

Enqueueing scripts selectively & activation where needed

If I enqueue my scripts selectively, for instance I have a slider I only want to load on homepage, which is activated in main-js, e.g: wp_enqueue_script( 'main-js' ); if ( is_front_page() ) { ...
0
votes
1answer
50 views

Function to prevent users from trashing comments

Is there any way to prevent/hide trash button for comments? Note that I only want to prevent users from emptying the trash for comments. Can't seem to find a way. Is there any possible way to do that ...
0
votes
1answer
102 views

template_redirect action only firing if logged in

add_action('template_redirect', 'add_header_redirect', 0, 0); function add_header_redirect(){ if( is_page(array(8, 'testimonials', 'Testimonials')) ){ $default_testimonial = get_permalink( ...
0
votes
2answers
120 views

Can't load wp-login [closed]

I can't get my wp-login form to load although main homepage does and site works... error log shows an error in functions.php on line 777, but there isn't one: [20-Dec-2012 11:24:55] PHP Warning: ...
0
votes
1answer
79 views

Shortcodes, output buffering, and WordPress functions

I have a couple of long forms which I want to output as shortcodes. Shortcode API indicates that If the shortcode produces a lot of HTML then ob_start can be used to capture output and convert ...
0
votes
1answer
21 views

Functions Error: Impacting Galleries

The function below controls an option inside an options panel. What it does is choose the number of posts being displayed in a particular archive (to_count archives, to_count_home, to_count search ...
1
vote
3answers
104 views

How to break down importing of feeds

I am attempting to update a large array of feeds into WordPress, using fetch_feeds. As can be expected, when going over 50 feeds the server is starting to time out. I would still like to update the ...
0
votes
0answers
41 views

Change image links via functions.php

I have seen many functions that auto add a class or "Rel=" to an image, what I want is something similar. I hope someone can help me do this function, I would like to automatically (via ...
0
votes
2answers
28 views

Is there a way to create a “copy post” link?

Much like the "edit" link when viewing a post, is here a "copy post" function I can include with my theme?
1
vote
0answers
26 views

next_/previous_post_link() `in_same_category` appears to fail when true

I'm using the Modernize theme's custom Portfolio type page. In the single-portfolio.php template, I call next_ and previous_post_link(), which correctly display links when in_same_category is set to ...
0
votes
1answer
42 views

Some problems calling a function into sprintf() inside functions.php template file [closed]

I am new in PHP and WordPress and I am personalizing an existent template and I have the following problem. In the function.php file of the template I have the following function: function ...
0
votes
1answer
59 views

How to hide a plugin metabox for non admins when a user adds a new post

I've been able to disable all the meta boxes for non admin in their backend but I'm having problems with Facebook AWD All in one which creates a widget seen by all the users when they create new ...
14
votes
3answers
13k views

Changing Admin Menu Labels

I have spent the last day using the functions.php file to fully customize WordPress for my client sites. I am amazed at how much I have been able to accomplish and how much easier it will make things ...
0
votes
0answers
9 views

Strange error when using enqueue jquery scripts in my functions.php [duplicate]

I like to use my own jquery version, and the only way to stop other plugins or wordpress loading in another version of jquery, I use this function below at the top of my functions.php // JQUERY 1.9.0 ...
0
votes
0answers
38 views

Wordpress installed under Magento - Php not executed in widgets [closed]

I installed Magento and under a subfolder of magento root (wp), I installed wordpress. Everything works well, excepting that php can't be executed if it's defined in widgets. I created this shortcode ...
0
votes
0answers
10 views

Google Not Indexing Multi-Page/Pagination Posts - Need Help With Code [duplicate]

I'm new to StackExchange and I guess I'm unable to comment on a post since I don't have enough reputation so I was wondering if someone could take a look at this answer (code) on this post (Multi-page ...
0
votes
2answers
37 views

How to add a class and title attribute to the link generated by next/previous post

The following code <?php previous_post('%', '&#60;', 'no'); ?> <?php next_post('%', '&#62; ', 'no'); ?> returns these links, as it should <a ...
0
votes
1answer
117 views

define css class in functions.php

In my theme I use theme options to set colors to categories (heading colors, dividers colors etc etc) The way I do it is defining variables which holds a color hexa like so: $category1_color = ...
-1
votes
1answer
172 views

Adding a second email address to a completed order in WooCommerce

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 ...
0
votes
2answers
61 views

Featured Image keeps cropping

I've spent hours trying to figure this out and its driving me mad. I'm not great with php code so I'm not sure if I'm doing this the best way anyway... It should be simple - I have built a custom ...
0
votes
0answers
25 views

Using _e() function and file.po

I want to translate some phrases in my wordpress template, and I use es_ES.po to translate from english to spanish with _e() function. Works fine but the question I have is: Is there any way to ...
0
votes
0answers
15 views

Printing shortcode as it is for demo purpose [duplicate]

I would like to show demo to my client. So I wanna print the shortcode as it is. For example like this [rawshortcode][gallery][/rawshortcode] So all the shortcodes I wrap within rawshortcode ...
0
votes
1answer
30 views

Function in functions.php by url

I want to use wordpress content in external mobile app. I need an URL address to get content from function located in functions.php for example: function test() { return 'it works'; } What I ...
0
votes
1answer
62 views

Display a list of users with avatar filterable with alphabets

I'm trying to create a page which should display a list of users with the role "Author" only and exclude all other default and custom roles. I also want them to be filterable by alphabets, so if I ...
1
vote
1answer
92 views

Merging PHP download script into `functions.php`

I run a large mixtape download site on WordPress. I'm currently developing a new theme and I'd like to include as much site functionality into the theme's functions.php. For serving the downloads, I ...
0
votes
0answers
17 views

Hide posts by a category and when it's the only one

Using the following script in functions.php you can hide a certain category on the home page. In this case the category with id 5. function exclude_category($query) { if ( $query->is_home() ) ...
0
votes
0answers
24 views

Widget options disappear when dragged to widget areas

When dragging a widget to a sidebar, it gets added, the throbber spins for a second and then all of the options within the widget disappear. So, the frame for the widget is there, but it's just empty. ...
0
votes
0answers
37 views

do_action in index.php and add_action in functions.php not displaying anything [closed]

I'm trying to display in my index.php a div created by a add_function in my functions.php So in my functions.php I have: function display_special_banner(){ echo '<div>Ciao</div>'; } ...
0
votes
1answer
397 views

How to add first name, last name and company name to my custom registration form

I´m trying to add first name, last name and company name to my custom registration page. The registration form almost works, but there is a problem. So far I´ve got this code, but I cant get the ...
4
votes
7answers
2k 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 ...
0
votes
0answers
28 views

Check Types custom checkbox and metadata when publish post

I´m using Types to create metaboxes with custom checkboxes to make some custom functions. The problem I have is with this function I created: function check_zone_tag(){ $postid = get_the_ID(); ...
0
votes
1answer
35 views

file.php not loaded?

I feel like I'm being really stupid. I want to make use of some functions in wp-admin/includes/file.php (like download_url), but it doesn't seem to be included, not in the dashboard/admin, or in the ...
-1
votes
1answer
44 views

Calling a function from functions.php in header [closed]

Been searching a lot for how to call a function in header.php where the function is in functions.php. How do I solve this? I have my function in functions.php like this: function testFunction() { ...
1
vote
2answers
516 views

How do I permanently Disable Attachment Post URL

How can I get rid of the attachment URLs completely? I don't want users to have the ability to link an image to the Attachment URL when inserting an image, ever. I've done things in the past like ...
0
votes
2answers
36 views

How to reset the plugins without deactivate the plugin

function set_copyright_options() { delete_option('ptechsolcopy_notice'); delete_option('ptechsolcopy_reserved'); add_option('ptechsolcopy_notice','Copyright &copy;'); ...

1 3 4 5 6 7 25