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
2answers
56 views

Theme options WP Editor

My text editor in Theme Options doesn't have font color option. How can I add that? I've searched around the web, but no luck. On regular pages and posts I can see the font color option. I'm using ...
1
vote
0answers
37 views

Default Custom Field Value Automatically Update

I have created a hidden custom field with a php function as its value. Like so -- $value_rating = get_post_meta($Property_Id, 'vr', true); <input type="hidden" name="vr" class="form-control ...
0
votes
0answers
20 views

Return a css class in functions.php snippet (WP Job Manager)

How can I trigger a CSS login lightbox when clicking on the "sign in" button on the following page (Wordpress Demo)?: http://workscout.in/post-a-job/ This is the CSS class that I found: <a ...
2
votes
2answers
54 views

Automatically insert php function into post $the_content

I am trying to have 2 php functions automatically inserted in every post for my CPT. The problem I am having is that even though I've found a way to add text, Im not sure how to add the php functions ...
0
votes
1answer
16 views

Solution dealing with Child Theme / Parent theme functions

This week I was struggling a bit customizing an exsisting theme for a client. To prevent the theme from being overwritten each update I created a child theme. This allowed me to cusomize most of the ...
0
votes
0answers
43 views

Why a class property becomes empty?

I have a class with a private property/variable named $postID that I can pass successfully (this was tested) to every function within this class except one named handleForm(). When it is passed to ...
1
vote
1answer
63 views

Gravity Forms - Using a Form to Pre-populate A Gravity Form

I have a custom form (hardcoded, not a GF) on one page I've written myself: <form id="tailor-select" method="POST"> <ul> <li> <ul> ...
0
votes
0answers
15 views

Add image class using a <select> input in media upload window & send to editor

I need to add the bootstrap "img-responsive" class via the media upload pop up. When users click the Add Media button, selects and image, there is an extra input select field below the description. ...
1
vote
0answers
14 views

Rewrite woocommerce categories widget urls

I am attempting to rewrite the list of categories url in woocommerce categories widget printed to the page. Not sure if I am adding this to the correct hook, or where I went wrong. function ...
0
votes
1answer
49 views

How to run a function when publish posts? [duplicate]

I have written a PHP function in a php page. This function is not written in function.php. I have written that function in anyname.php file which is located in root directory. I need to call that ...
0
votes
0answers
41 views

Add product to cart and change price, within template file

I'm trying to add a product to the cart which has a price of 0.00 and then dynamically change the price depending on what the user on my site inputs into the form I've made. I've looked at a couple ...
0
votes
1answer
25 views

Passing the custom field values in the wp_get_current_user array function

How to pass the custom field values which were stored while creating a new user into the wp_get_current_user array function When I call the wp_get_current_user() function the result which I found is ...
0
votes
1answer
80 views

Using Wp_Query, Json to add Highcharts series data

I just added a custom Highchart to my wordpress single custom archive page. http://propertywise.malisa.agency/en/district/khlong-toei-2/ Using the following function call from within the Highcharts ...
0
votes
0answers
10 views

Can't get URL rewrite to work for participants database plugin

I am fairly new to WordPress, but here we go. For the past 18 hours or so, I have tried every method I have found on the internet in an attempt to force the url example.com/file/?pdb=3 to become ...
0
votes
0answers
28 views

problem with php script inserting categories in wordpress

I have a php script taking categories from softonic.com, and im trying to insert them into my blog, but I have a few problems. The first of all, is that the categories are not with any link into my ...
1
vote
2answers
58 views

My simple custom shortcode is not longer working (possibly due to upgrade to WordPress 4.4 ?)

I have a simple function in functions.php that creates a custom shortcode: function my_line_break() { return "<br>"; } add_shortcode( 'new line', 'my_line_break' ); Now, I don't know if ...
1
vote
1answer
32 views

Placing raw HTML inside a WordPress shortcode

My shortcode: function fullwidthFunc($atts, $content = null) { $atts = shortcode_atts(array( "backcolor" => 'transparent', "backimgurl" => '', "color" => 'black', ...
0
votes
0answers
17 views

can't see categories in appearance-menu-categories

I have a php script that takes categories from softonic.com. It is supposed to insert these categories inside an apps category. It does it with wordpress functions. After launch my script I can see ...
-1
votes
1answer
19 views

Trouble figuring out how to get my button to submit comment

I have a text area in the sidebar (sidebar-chat.php) of my posts page with an input that is an image. When this image is clicked, the comment is supposed to submit. I am just having trouble figuring ...
-1
votes
1answer
27 views

How do I add functionality to images?

How would I add functions to images? I host a photography site, in which I'd like to add options to favorite an image or attach it to a product for ordering. Is there a hook or something that I can ...
0
votes
0answers
32 views

get_comments not working properly after WordPress v4.4 update

I just found a wired thing on my website after v4.4 update. In my blog pages I use 2 functions to fetch comments. First I use wp_list_comments( array( "callback" => "checkout_comment", "type" ...
4
votes
2answers
46 views

syntax for remove_filter in parent theme with class

I'm trying to remove a filter on the register_url hook a parent theme added, that seems to have a class nomenclature I can't figure out. Ordinarily, a filter for this hook would be easily added like ...
0
votes
1answer
37 views

insert thumbnail image from php script

I'm trying to insert a post image thumbnail from my php scritp. It's inserting the post, the content, a download link, and I only need to set the thumbnail image to finish my script. This is my code ...
0
votes
0answers
33 views

Active menu item post detail

I'm trying to make the menu item active in WordPress when clicking on a a post item. The way im matching it is based on the browser url and the url of the menu item. However it is making all my menu ...
0
votes
1answer
19 views

How to slow down server response

I've been trying a few methods to slow the loading of my Wordpresss installation by x seconds but I've had problems which each try: Javascript sleep() does the job but my hoster emailed me saying my ...
0
votes
0answers
29 views

Woocommerce “Minimum Order Amount” rule in multiple currencies

Working on a store with base as India (Rs.) but, people can pay in multiple currencies & from multiple countries - but can only ship to a address in India "Minimum Order Amount" for free ...
0
votes
1answer
15 views

custom COOKIE on custom page

i have problem with create function for set cookie dynamically. when i try in custom page i have of course header is set and i tried something like this: in custompage.php: ...
0
votes
1answer
24 views

How to make a cookie be on the whole site instead of being on a specific page/

So I had an idea to make a button that swaps between css files in order to do random stuff such as making 2 backgrounds that the site users will be able to swap between. I had no idea how to do it, ...
0
votes
0answers
16 views

js-methods with prefix specified

I have wordpress plugin with js-file attached for js functions. I want to escape possible error of having js functions with the same name as js functions pf other developers so I use some prefix like ...
1
vote
1answer
76 views

How to change post status from publish to draft using hook in wordpress?

I want to change the status of already publish post to draft using its id. add_action( 'save_post', 'change_post_status', 1 ); function change_post_status( $post_id ){ $my_post = array( ...
1
vote
1answer
57 views

get_post_type() in in_array doesn't work for some reason

I am trying to create some function for metaboxes and some reason i can't get get_post_type to work in in_array. Everything else seems to work in testing but in_array nope. This is the function that ...
0
votes
0answers
22 views

Integrate Stripe api into Bedrock/Sage theme

My question is how do i get WordPress to recognize my new class so i can use it in my charge-card.php AND how do i get it to load Stripe in my actual class, using doesnt seem to work. I'm pulling in ...
0
votes
1answer
24 views

How to debug vars inside function at functions.php file?

I have this function: function wpse_210493_apply_advertising_position( &$posts, $return = false ) { $ad_posts = array(); $content_posts = array_filter( $posts, function ( ...
0
votes
0answers
54 views

Custom post type to display multiple map markers

So I have a google map that I need to display multiple markers on. I have it working with a manual array to display the markers, but now I am trying to make this dynamic using custom post types. ...
0
votes
0answers
23 views

Accordion Menu not being called

I'm trying to add a vertical accordion menu to my custom theme, and I have no idea what is not working. The original tutorial is here : http://cssmenumaker.com/blog/wordpress-accordion-menu-tutorial ...
0
votes
0answers
9 views

How can I enequeue GruntJS concat imagemin output?

After reading countless tutorials and learning how to output solid files using both the concat and imagemin plugins for GruntJS, I have yet to see how I can actually include the output files into my ...
0
votes
1answer
26 views

How to use functions [closed]

I have installed the plugin WPdeposit on my site, it allows users to deposit into their account balance. I am trying to manipulate users balances when they press an anchor tag on the page. In the ...
0
votes
2answers
88 views

Excerpts are not displayed by a shortcode on category pages

A 3rd party plugin that I use adds a shortcode that displays a list of adverts (CPT posts). The shortcode function includes (with an include statement) a template - the list.php file, that displays a ...
0
votes
2answers
39 views

PHP Output also in Child theme, but different

I have a multilingual site setup: www.jeroenbrugman.com The main dutch version uses Fluxus. On the artwork page I output a link using this from Functions.php function prefix_term_name($terms, ...
1
vote
1answer
45 views

Limiting woocommerce line_total decimal length

I am trying to get line_total woocommerce price, but i just cant figure out how to deal with number of decimals. It is now showing price with 4 decimals like 5.5444$ and i want it to show max 2 ...
0
votes
2answers
43 views

how to repeat taxonomy in different places on wordpress

I need help with this. I need repeat taxonomy in two places, are post, and coupones post, this code is in clipper theme. this code put taxonomy stores in coupon. add_action('init', 'clpr_post_type', ...
0
votes
1answer
65 views

Do we need to change our child function.php to require/include child dir files when we add an over-riding file.php into the child theme

With child themes we are supposed to leave parent functions.php in tact and extend it with the child functions.php. However parent functions.php typically define a whole load of include/requires which ...
0
votes
1answer
50 views

Find all strings between an enclosing shortcode

I want to look for all strings in my theme located between my enclosing shortcode [question] desired string [/question]. Then I want to output the so collected strings somewhere in my theme , e.g. ...
0
votes
2answers
49 views

Pass Shortcode Attribute to footer Script

i am trying to generate a wordpress shortcode which will display a (bx)slider. The shortcode function itself works like a charm, i can pass my data and the shortcode gets rendered well. The problem: ...
0
votes
1answer
47 views

using `require` in my functions.php breaks the site

So, I have a snippet of code I'd like to tidy away in a directory that's close to the root my wordpress directory. Specifially it lives in /includes/inc. I've created a file called test.php and ...
0
votes
1answer
34 views

Retrieve a custom form field modified by a filter

I use a 3rd party plugin that creates a form with some fields. I want to use one of these fields in one of my templates. Is there a way to do this? UPDATE I found a solution, see the accepted ...
0
votes
1answer
41 views

Splitting the_content() by size?

I have a situation where users don't want to format quotes in post body and want to just paste their content, assign a quote in a custom field, and the template will now render the quote when viewing ...
0
votes
2answers
17 views

Adding wrapper elements in the_date() like in the_title()?

So this works: the_title( '<h1 class="entry-title">', '</h1>' ); But this does not: the_date( '<h4 class="entry-date">', '</h4>' ); I don't know enough if this is ...
0
votes
1answer
25 views

Make menu structure match page heirarchy on page parent change

Old WordPress themes like twentyten contained functionality which allowed nav menu structure to reflect changes in page heirarchy. For example, if I have the arbitrary page heirarchy (and matching ...
0
votes
1answer
50 views

Improving the perfomance of a plugin action

I want to override a 3rd party plugin action with a new action, but in comments to my another question @pieter-goosen suggested that this plugin action is very very expensive, in terms of using server ...