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

Getting autoset_featured image to jive with Facebook SDK

I'm trying to set up the Facebook SDK on a site where I'm auto-fetching the first image in the article to become the "featured-image". I would like that auto-fetched image to also be the og:image, but ...
0
votes
0answers
18 views

MPT Usage with NewsPaper WordPress Theme

I am using Multiple Post Thumbnail Plugin with NewsPaper WordPress theme Plugin Documentation: https://github.com/voceconnect/multi-post-thumbnails/wiki/Frequently-Asked-Questions Hello, I used ...
0
votes
0answers
38 views

Call to undefined function language_attributes(), add_action(), wp_header() and wp_footer()

Using a new theme for a Wordpress website I found yesterday in my error report that: Call to undefined function language_attributes() in header.php Call to undefined function add_action() in ...
0
votes
0answers
26 views

List authors by first letter with letter per page

Currently I have this working with first letter of post title with letter per page. <div class="alpha_navigation"> <div class="inner_alpha_navigation"> <?php foreach ($letters as ...
0
votes
0answers
36 views

Fatal error: Call to undefined function wc_format_decimal() in class-wc-meta-box-product-data.php on line 996

I Get this error when trying to add a new product. If I refresh the products page, the new product will show up. I can make changes to the product information but the price never updates. It just ...
0
votes
0answers
37 views

Embed handler in custom field

I am trying to implement wordpress function wp_embed_register_handler() into a custom field. Using this instead of wp_oembed_add_provider(), for the urls I use do not offer oembed support. With help, ...
0
votes
0answers
13 views

function to add radio inputs that set custom fee

I'd like to add a custom fee to orders, and have that custom fee be chosen by the customer. So, under the 'Add to Cart' button, there should be a few radio inputs with set dollar amounts. By ...
0
votes
0answers
20 views

Override a __construct function in child theme

I'm trying to override a loop function in a child theme. I've tried a lot of things I found on google, but something fails, sometimes nothing change, sometimes I get a 500 error. This is the original ...
0
votes
0answers
17 views

How do I redefine wm_navigation() or wp_logo() within a theme that uses hooks?

What I want to do: Move the title of my website from it's current location to be in the "menu" div so that it is to the left of the menu/page list. Demo page: http://aaronmoore.me/visartsassignments/ ...
0
votes
0answers
50 views

How to get last order number in Woocommerce and insert next?

I am developing an offline product to retail. This will be sold by a distributor NOT through my website. I have an sequential order reference system based on woocommerce such as 152, 153 etc. I want ...
0
votes
0answers
169 views

WooCommerce - Customer Order History Pagination

I'm trying to implement pagination into WC's customer order history that can be seen on the "My Account" page using woo_pagination(). https://docs.woothemes.com/document/woo_pagination/ The template ...
0
votes
0answers
18 views

Add extra attributes to images via editor

Would like to allow editors to add: data-action="zoom" to image tag without them having to code it. Preferably from a TinyMCE button/menu. Example: <img class="alignnone wp-image-2438" ...
0
votes
0answers
36 views

How can I make a function as sticky expired date post?

I want to edit functions.php to make a sticky post, the flow is post a post, clock will start and after 1 hours, the post will be disappear. Anyone can help me? Please. I have tried, I am really new ...
0
votes
0answers
29 views

How to send Email to Dealer email id when order is cancelled woocoomerce

I am trying to send the mail to my Dealer which user has choose during checkout that your order is cancelled . I have prepared a system to which sends email when order is placed my code is ...
0
votes
0answers
17 views

add post type support not showing edit author options for all users

Need to allow all users (admins) to be able to edit the authors of a post. Added this to my wp-admin.php in the inc/functions folder but is hasn't worked: add_action( 'init', ...
0
votes
0answers
35 views

Removing A Parent Theme Template

There is a template with code that I want to prevent the child theme from loading. All it does is load a little date box. What i've done is duplicate the hierarchy of that template file located in the ...
0
votes
0answers
26 views

wp_verify_nonce() didn't work in the function

I'm creating link with wp_nonce in GET parameter: $link = esc_url( wp_nonce_url( add_query_arg( 'my_arg', 1 ) , 'product_subscription' ) ); echo '<a href="'. $link .'">'. $link .'</a>'; ...
0
votes
0answers
17 views

Everytime I press Save Settings from a Plugin it redirects to All Settings page

I have developed a settings page for a theme in which I'm working in order to have some options to customize it. Here are all the options and here is the functions.php. I don't know why but when I'm ...
0
votes
0answers
23 views

How to protect a comment with a password?

Is there any way to Protect a comment with a password so that the comment can be seen only when the right password is entered. I know a post can be password protected , but thats not the way i want ...
0
votes
0answers
27 views

Function returning same value for all posts

I have this function to get the size in KB from a file. It works like a charm as long as it's on a single post. However, if I do a query, all posts take the value from the first post. Thus, if the ...
0
votes
0answers
32 views

Entire site breaks when error in a php file because of multiple get_template_part in functions.php

I bought a WordPress template and I'm modifying it to fulfill my needs, But I have a problem. Whenever I there is an error in one PHP file, the entire site (including the homepage) breaks. I see that ...
0
votes
0answers
27 views

Javascript attr href not appending parameters on WordPress site

I have this exact code set up and running on a regular HTML/PHP site but when I tried setting it up in WordPress, it doesn't work. The code itself works, the Javascript is present when I view the ...
0
votes
0answers
35 views

add_menu_page and URL parameter

It is possible in WordPress to add a url parameter to the add_menu_page slug? Only found solutions for a submenu page. Odd thing is that if i add a node to the admin bar which has the link ...
0
votes
0answers
42 views

Custom WP Admin pages do not display after trying to add child to functions-admin.php

I am building a theme options page. I have a parent page with 3 sub-pages under that. Volcano (Parent) Sidebar Theme Options Custom CSS The Problem: All of these settings are not displaying at ...
0
votes
0answers
41 views

Enable/disable code in functions.php with options

Is there a way to enable or disable lines of code in a themes functions.php file? Basically I would like to have a page in the admin panel that lists "modules" or separate php files and has the ...
0
votes
0answers
7 views

Cachebust child theme stylesheet queston

I am using the below to cachebust my child theme stylesheet with a version number. I noticed that Wordpress continues to try and load my original child stylesheet "style.css" in the head even though ...
0
votes
0answers
52 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 ...
0
votes
0answers
40 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()) ...
0
votes
0answers
163 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
0answers
22 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 ...
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 ...
0
votes
0answers
28 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. ...
0
votes
0answers
147 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
0answers
13 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
37 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 ...
0
votes
0answers
24 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 ...
0
votes
0answers
49 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" ...
0
votes
0answers
38 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
0answers
50 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
0answers
17 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 ...
0
votes
0answers
44 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
0answers
124 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
25 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
0answers
16 views

function 'wp_heartbeat_set_suspension' not found or invalid function name

Woke up to find this error mysteriously appear on the admin pages of my website Warning: call_user_func_array() expects parameter 1 to be a valid callback function 'wp_heartbeat_set_suspension' not ...
0
votes
0answers
31 views

How set offset on query with specific post_type from functions.php

I have a page template called 'page-blog.php'. On that page I have 2 queries that both obtain the posts of a different post type like so: $posts = ...
0
votes
0answers
21 views

Function for moving a sub menu under a different top level menu?

I have a snippet that will allow me to make submenus become top level menus, but can you help with a snippet that will allow to move a submenu to be the submenu of a different top level menu? For ...
0
votes
0answers
22 views

How to integrate a code through function

so I'm having this big issue with replacing a code with another via function. I just copy pasted an example code from the plugin developer which at the moment is unable to assist me. This is the code ...
0
votes
0answers
22 views

How to get a variable into a buddypress function?

I have a function to create profile subnavtabs in buddypress: function my_custom_subnav() { global $bp; $collection_term = 'FOO'; bp_core_new_subnav_item( array( 'name' => ...
0
votes
0answers
28 views

Pagination not displaying

I'm using HTML5Blank theme to edit my own theme on clean basis, and trying to set the pagination but it's not displaying for some reason, and I cant find out why. Index.php calls loop then pagination ...