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
0answers
37 views

Create user from external file

I have this little script for create user from page of template i use in wordpress template page : $user_name = "usertest"; $user_pass="123456"; $user_email="myemail@domain.com"; wp_create_user( ...
0
votes
0answers
49 views

WP Function still having effect after being deleted

I wanted to hide the add to cart buttons in Woocommerce so I created a custom plugin and added the following code to it: function remove_loop_button(){ remove_action( ...
0
votes
0answers
28 views

Strict Standards: Declaration of … should be compatible with [duplicate]

I try this answer, and i changed the function start_el(&$output, $item, $depth = 0, $args = array() ) { but it did not work. The problem is, I have this theme, link here. and I'm getting this ...
0
votes
1answer
34 views

date function not correctly returning date

This code is being used to generate the date of a post in wordpress: <span class="the_date">Posted: <?php echo get_the_time('F d, Y'); ?></span> However it is not resutning the ...
0
votes
1answer
127 views

Fatal error: Call to undefined function the_ratings_results()

I was wondering if I rack your brains a bit on this one. I have a custom theme that has files in the theme folder but do not load as wp template files on the page settings. I also run EDD (easy ...
0
votes
1answer
115 views

How to use WP_rewrite?

I need to add the following rewrite commend to WordPress .htaccess file: RewriteRule ^read/([0-9]+)/?$ /read/?u=$1 [QSA,L] How to do this by a function? i.e., how to do it by use wp_rewrite in ...
0
votes
0answers
32 views

global vars in wordpress no works fine

I have 2 global vars defined inside funtions.php global $ruta_path; global $ruta_db; I want send the value of this global values to function in comments but no get works Inside comments.php i have ...
0
votes
1answer
34 views

Wp get archive only text not link

i use this function wp_get_archives( array( 'type' => 'yearly', 'limit' => 12, 'format' => 'html' ) ); And i got this: <a title="2013" ...
0
votes
0answers
95 views

Site is not updating because something is wrong with custom code. How to fix it?

I really didnt know what a proper title for this question could be. Anyways, I have this code in functions.php which is breaking my site function wp_show_post_views(){ global $post; $postid = ...
0
votes
1answer
255 views

Changes doesn't show up on blog

I am using wordpress in my magento using Fishpig wordpress extension, i have created a functions in functions.php of my theme (though its full integrated, meaning magento theme is applied to blog) but ...
0
votes
1answer
98 views

Remove submenu item from list

I have the following script within my functions.php file to avoid certain users from modifying things they shouldn't and would like to remove one more item, the Appearances > Themes submenu. function ...
0
votes
2answers
158 views

Shortcode to find and replace URL

I'm trying to create a shortcode that will search within some specified text for a link and replace it with one that I specify. For example: [scode]Click on <a href="www.X.com">this ...
0
votes
0answers
48 views

using enqueue_script in a shortcode isn't working

I'm new to wordpress and I'm trying to get this to work by following the wordpress codex but I feel like I must be missing something obvious. I have a child theme based off of a parent one, and I ...
0
votes
0answers
233 views

Display default WordPress login/registration form into a modal window

hope someone can help me with this. I need to display the default WordPress login/registration into a modal window. I followed this tutorial in order to create the modal box and it is just exactly ...
0
votes
2answers
48 views

Undo a function that is not (seemingly) hooked to an action?

I am using the popular Disqus plugin. To use this plugin effectively, they advise you to change the URL on the front page to end in #disqus_thread. I know how to easily do this in jQuery, but I ...
0
votes
1answer
86 views

Metabox Input Not saving

I haven't made any meta-box's in quite some time so quickly threw together this one for a website I'm developing. My problem is that when I input some text in the box's and hit save the text ...
0
votes
1answer
95 views

I want to split this into two functions

This code i will add below is for Custom Fields for Custom Post Type and GMap for Custom Post Type. Currently both are pulled by this function. I want to seperate both. One for Custom Fields and One ...
0
votes
1answer
151 views

Can't change excerpt length and more tag

I tried to change the excerpt length and the more tag the way it is described in the codex: function custom_excerpt_length( $length ) { return 10; } add_filter( 'excerpt_length', ...
0
votes
0answers
313 views

How to fix Warning: call_user_func_array()?

I modified my theme metabox.php to fit my needs, and I got this eror Blockquote Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'mytheme_add_box' not found or ...
0
votes
0answers
47 views

How to structure plugin in to functions?

So I have customized a few plugins before, but never developed one from scratch. One thing that I have struggled with is structuring my functions. I found the following snippet and wonder how YOU ...
0
votes
2answers
55 views

If no input don't display?

First of all i am sorry if my question is not correct formulated, i am new in to wordpress and php. I hope i am not being too silly. i have this: <div class="propsmeta clearfix"> ...
0
votes
0answers
79 views

Submit password to Ushahidi Platform using gform_after_submission

OK basically I run Wordpress as CMS and Ushahidi for collecting information from different area. All I want is a registration form that send data to 2 different platform. I used Gravity Form ...
0
votes
2answers
239 views

Get the alt text of the image in a array

I have a php code. That put the thumbs on the screen. I have this: <?php if (has_post_thumbnail()) : ?> <div class="image"> <?php $attachment_id = get_post_thumbnail_id(); ...
0
votes
1answer
77 views

Create dropdown of users in admin dashboard

I'm trying to make a list of users come up in a widget in the admin dashboard. So far i've got it showing up, but I want the list to show a custom field from the user's profile instead of the normal ...
0
votes
1answer
127 views

Highlight main menu when on specific posts or pages

I am using Genesis and have written a custom function which works fine, but is very ugly and includes a css statement. The object is to highlight a menu link in the main header menu when on certain ...
0
votes
1answer
56 views

WordPress display name string manipulation

I have set the display name to show both first name and last name using the function below. How do I manipulate the LAST NAME to only pull the first letter of that string? Example, if you sign up as ...
0
votes
1answer
42 views

If no author posts, echo out some text

I have this piece of code to show the author posts of the author of the current post, but I want to make an if statement, if no posts then echo out some text. I have now this but it do not work (above ...
0
votes
0answers
101 views

Add CSS Classes Field to Media Uploader

I need a functions.php hook that will allow me to add the standard CSS Classes field to the "ATTACHMENT DISPLAY SETTINGS" section of the Media Uploader modal. I know the css class field can be ...
0
votes
1answer
93 views

Guest Author - How to modify my custom function code if the guest author URL will follow a particular pattern/format?

Based on code the awesome G.M. provided in an earlier question (Use Custom Fields to Create Guest Author Link), I now have a custom function that uses custom fields to support guest authors. The code ...
0
votes
1answer
741 views

Guest Author - How can I use custom fields to create guest author link?

We are posting articles authored by guest authors. The guest authors will not be logging in to the site, and we don't want to create users for these guest authors. We are also not interested in any of ...
0
votes
1answer
208 views

Getting images from media library and get_the_date() not working

I've got a function to display all images in the media library on a page. I would like to display the date of each image, but using get_the_date() only returns today's date. Here is the code I'm ...
0
votes
0answers
74 views

Adding result from PHP function into an input field

I have the following PHP code which is a template page for a wordpress site: <?php /* Template Name: Calculator Form */ get_header(); ?> <div id="content" class="grid_7 suffix_1 <?php ...
0
votes
0answers
150 views

Functions.php not working in 2013 Child Theme

I have created a child theme base on the new twentythirteen theme. I made a style.css file and put a few styles in it. I've selected the child theme and my css styles are working. No problem there. ...
0
votes
1answer
53 views

Additional Sidebar

Hi I wanted to create extra sidebar in my theme and I am not sure if what I did is correct. In my theme functions.php I found this function: function blankslate_widgets_init() { ...
0
votes
0answers
170 views

HTTP_HOST changing in functions.php

I have getting variable results from the $_SERVER['HTTP_HOST'] variable in the functions.php file of our child theme. Let me explain our setup and then I'll explain the issue. We are running WP ...
0
votes
1answer
554 views

Remove wp-mediaelement.css from wp_head

I´m customizing the new core audio/video player via CSS in my styles.css. I tried to remove the wp-mediaelement.css with the following code in functions.php, because I don´t need it anymore. function ...
0
votes
2answers
309 views

How to add icon over specific thumb

I wanted to do the following, and I know its possible, but I don't know how. I'm looking at in_category, but it doesn't make to much sense. Basically what I want to do, for an example on my homepage, ...
0
votes
1answer
64 views

Theme Customizer - Custom Sections Display, but do Nothing

I'm creating a theme and I've started doing some work on the theme customizer. I'm going to do all of it in the theme functions, but I have an issue I want to figure out first: I've added a ...
0
votes
0answers
56 views

Using array page name together with page id to deregister script

If I use this: if (is_page(array(blabla-test-page, 20726, 20720, 38881))) {wp_deregister_script( 'gdsr_script' ); } the blabla-test-page looks like it overrides different pages, even if certain ...
0
votes
0answers
170 views

Changing /author/ link to something else: what is a better way?

Is there a better way than this snippet I am using? function change_author_permalinks() { global $wp_rewrite; // Change the value of the author permalink base to whatever you want here ...
0
votes
1answer
47 views

Search box background on a different page template

I'm trying to make the search box background the same as the homepage, but for some reason there is a orange background - it doesn't use a different header.php its called within a filter the code ...
0
votes
0answers
191 views

Full size image option removing problem

I have removed the Full size image option from the media upload window see Code: function theme_t_wp_set_image_size_options( $sizes ){ $sizes = array( 'thumbnail' => 'Thumbnail', ...
0
votes
1answer
220 views

display last post modified date in genesis child themes

Since I frequently update posts so it’s crucial for me to display last modified date instead of post published date like following image. Its because I want search engine to display my post last ...
0
votes
1answer
517 views

Only let plugin add actions to wp_head & wp_footer on single posts

I'm using a a plugin (Comments Evolved) on a recently built site. The issue I'm having is that this plugin globally enqueueing and adding actions to the head and footer of all pages. I'd like to ...
0
votes
2answers
208 views

Function to get thumbnail img source

I have this function call that displays an entire img tag with the correct url for that post.. the thumbnail img... ?php the_post_thumbnail('blog-page'); ?> What I need is just the source ...
0
votes
1answer
108 views

WP Ecommerce: Display the “Order Notes” as column in the Sales Log

I have the following function that adds a column in the Sales Log so that I may show the Order Notes. Adding the column is good and showing the id of each item ($item->id) as test is good. Where I am ...
0
votes
1answer
165 views

enqueue script if page is not equal to

I'm registering some js scripts in my function.php, I have 2 versions of one js file, one FOR the homepage, and one for every other page. I've managed to get this to work to register the homepage ...
0
votes
0answers
420 views

How to add a class name to the ancestor <li> of a post?

I've asked this question before with a different Question Title over at Stackoverflow. At that time, I was not yet aware that a function of the theme is adding a class name called current-menu-item. ...
0
votes
1answer
100 views

How do I change the URL returned by next_posts_link()?

I am integrating a WordPress blog into my existing portfolio, test.mysite.com. The WordPress default twenty twelve blog appears on test.mysite.com/blog/. I want to integrate WordPress functionality ...
0
votes
1answer
29 views

get_the_title in edit post_link

Basically I would like to link to the edit post interface in Wordpress with the string to display being the post title. Cannot get it to work have tried any syntax that I could come up with, but I am ...