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)

1
vote
1answer
23 views

Unique sequential reservation code

I have a situation where I'm re building a tour transfer reservation site, I've created the reservations cpt's and each time a user place a reservations this automatically post as a new reservation. ...
1
vote
0answers
55 views

bulk change of image setting “link to” to “link to: image url ”

i want every image present on my wordpress site with setting "link to: none" or "link to: post url" became in "link to :image url" ho make this for old post and for new post ? i tried this code in ...
1
vote
1answer
54 views

Cannot save CPT meta box

I swear I have tried every tutorial, and looked through every Stack Overflow thread to figure out what I'm doing wrong... I'm creating a custom wordpress backend for a church that includes a place for ...
1
vote
0answers
55 views

Displaying Login form with Shortcode

So I am trying to display a working version of the default wordpress login form on one of my pages. There is code in the functions.php file that creates the shortcode and as far as I know it works ...
1
vote
0answers
23 views

Categories as main menu items and subcategories as nested lists

I am new to WordPress and am trying to make my website. Would it be possible to list categories and subcategories as a nested list with links in the main navigation menu. What am i trying to achieve ...
1
vote
1answer
30 views

Multiple Loops Inside a Function

What I understand from the CODEX, (https://codex.wordpress.org/Class_Reference/WP_Query#Multiple_Loops). then I'm trying to do a list of posts like this: <nav id="cbp-hrmenu" class="cbp-hrmenu ...
1
vote
2answers
70 views

Change WP attachment name to postid during upload only for post type

I know there is many solutions how to rename attachment while upload files to postid. I got correct solutions that really works fine is: http://wordpress.stackexchange.com/a/30767/86517 (I'm new and I ...
2
votes
1answer
64 views

How to override functions.php in child theme?

I have a theme and I need to override some specific parts|behavior of it specifically on the functions.php file. I know the best practice here is doing this at child theme by placing a custom ...
4
votes
1answer
180 views

WP 4.4. responsive loads normal image after loading the responsive image

I have the 2 new added sized that I am testing: // testing add_image_size('new-small', 500, false); add_image_size('medium-large', 768, false); // just added today for devices support image ...
1
vote
0answers
100 views

ajax category filter

I know this is a big ask for you guys, but i can't seem to figure this out. I found this page : http://www.bobz.co/ajax-filter-posts-tag/#comment-28112 it shows how to make a dynamic filter for post ...
1
vote
2answers
35 views

Wordpress Page Restrict

Im currently using a theme that has template pages, and they notified me that I cannot use any page restriction plugins, as for that would only work on the default template page. Id like to restrict a ...
1
vote
0answers
92 views

Change logo based on incoming domain

The agency I work for are trying to get a client's logo to change based upon the incoming URL. Now, we have 4 different URLs, therefore 4 different logos. Currently, we are using an if/else ...
1
vote
0answers
28 views

Woocommerce Storefront WordPress Ignore Media Gallery Images and use External 3rd Party Host

OK, firstly we have done this before using Magento and it worked well, but with WordPress? Well, here is the problem and the plan... The Problem For a few reasons we wish to use a 3rd Party host for ...
1
vote
1answer
26 views

Is checking whether the blog is installed necessary?

My Wordpress site has become kinda slow and unresponsive, so I am trying what can I do to speed it up by eliminating unnecessary database queries and other things. I stumbled across suggestion found ...
1
vote
1answer
178 views

woocommerce change currency per category [closed]

I am trying to display a different currency on a specific category within my Woocommerce store. Specifically, this category is full of items that can only be purchased through myCred points. The rest ...
0
votes
1answer
253 views

how to make custom ajax handler?

i'm trying to make custom ajax handler because the admin-ajax.php is taking to long to handle ajax requests from 7s to 10s so i google it and mange to do some custom ajax-handler.php like this <?...
0
votes
1answer
31 views

Create 2-layered dropdown menus for custom taxonomy and custom post type

I want to display one dropdown menu with a list of values for a custom taxonomy. My taxonomy is "issue-year" and the dropdown would look like this: <select name="issue-year"> <option ...
0
votes
0answers
56 views

enqueue css in a wordpress plugin condition

I have found a bug in a wordpress plugin /plugins/woocommerce-eu-vat-assistant/ In checkout page if the option "Added possibility to make EU VAT field compulsory when the customer enters a company ...
1
vote
2answers
93 views

PHP code inside shortcodes

Basically, I have this line of code: <?php echo do_shortcode('[O_U user_name="operator" blocked_message="This page is restricted for guests."] **Content Goes here** [/O_U]'); ?> Now, inside ...
0
votes
0answers
51 views

Moving CDN jQuery to footer does not work?

What I want to achieve: Change the default JS to Google's CDN --> this works Move the Google CDN to the footer --> this does not work My code: function my_init() { if (!is_admin()) ...
1
vote
1answer
33 views

Checking array against author id in loop

So I have a function in Wordpress with a plugin that returns a list of friends as an array. The function code is here: function friends_get_list($tmp_uid, $friend_status=1) { global $wpdb; $...
1
vote
1answer
87 views

wp_dropdown_categories and custom attribute

I'm using this jQuery plugin to handle select element on my site: bootstrap-select Unfortunately, I can't found any option which allow me add a custom attribute to the select element, for e.g: I ...
1
vote
3answers
152 views

How to add background image control to page admin controls?

I understand that each page is assigned its own class such as .page-id-22 & I can use that to assign a background image to it using the stylesheet but I've seen a theme that adds a control to the ...
0
votes
0answers
249 views

Save WooCommerce custom field values without “Updating” Admin Post

I'm creating a website that is on the WooCommerce platform and what I'm essentially trying to do is add another option to the sorting feature of the plugin by using a manually created custom field (...
0
votes
1answer
53 views

get second ID from array

I need to get the second attachment ID from this function and put it into a separate custom field: add_action('pmxi_saved_post', 'replace_thumbnail', 10, 3); function replace_thumbnail($id) { $...
1
vote
1answer
22 views

How to customize a permalink (URL) structure?

i am using $post->guid to get the URL of an attached file to my post. the output is something like this: http://example.com/foo/ [where foo is the file name]. now i want to make a URL like http://...
12
votes
3answers
488 views

How to deprecate a function used in a plugin?

One of the functions I'm using in my plugin is polluting the global scope with a name that could collide with another function (used in another plugin). So, I guess I should deprecate it. But how ...
0
votes
1answer
41 views

Adding product to WooCommerce cart [closed]

I have a product category called mobile. In every mobile category product purchase I need to add a free product and it's ID is 1245 to the cart automatically & customer needs to see a message that ...
2
votes
2answers
153 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
49 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
24 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 href="#...
2
votes
2answers
118 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
22 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
45 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
301 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
61 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
25 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
150 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
246 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
61 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
139 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
16 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
44 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
64 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
72 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
26 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
21 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
31 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
57 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" =&...
5
votes
2answers
100 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 ...