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

Changing a button label of WP_Customize_Image_Control() doesn't take effect

I tried to modify the Customize Image Control class and replace the instance of 'default' => __( 'Default' ) with 'default' => __( 'NEW LABEL' ) and re-classname it like this: class ...
0
votes
2answers
20 views

How to store / access files in child theme folder

We are moving a HTML/PHP site to WordPress and want to use as much of the current code as possible. We are using the Avada theme, and have created an Avada child theme folder with the 2 required files ...
0
votes
0answers
23 views

Conditional required fields for Wordpress Contact Form 7

I know this might be considered off topic but I am not sure where else to post this as it also pertains to WordPress as well as the plugin Contact Form 7. If you know where I should post this other ...
0
votes
1answer
20 views

Custom posts - tag pagination

I'm using the following code to output the custom posts that belongs to a tag: add_filter('pre_get_posts', 'query_post_type'); function query_post_type($query) { if(is_category() || is_tag() ...
0
votes
1answer
26 views

How to set up an auto delete post?

I want to create a form in which when a front-end sets a date and on that date the post gets automatically deleted. Is it possible?
0
votes
1answer
23 views

How to override this theme function in child theme

I'm working in a child theme and I need to override a function in order to remove some unwanted items on a top menu. So I have research a bit and found a lot of docs, really, like this, this and this ...
0
votes
0answers
19 views

Display a fallback image when a specific metabox is empty [on hold]

I am having trouble displaying a fallback image when there is no image uploaded to a custom file metabox. My file metabox is call depmayorShot and when it is left blank is is suppose display ...
-1
votes
0answers
16 views

How to add a query string to all url of a page category (woocommerce shop category)?

I need to display by default the list view activated by the query string "?product_view=list" only in certain category list pages of my choice (es: ...
0
votes
0answers
11 views

Query custom post in tag archive

I created a custom post and added the standard Wordpress tag functionality: function btp_work_register_post_type() { $args = array( 'label' => __('Works', 'btp_theme'),'labels' ...
0
votes
1answer
25 views

Getting out side of wp root folder from function.php using absolute path

Hi Everyone I am having a relative path issue with linking a css file using a absolute path. Basically I am having the exact same problem as the person here however I do not want to use the URL of ...
0
votes
0answers
12 views

Custom loop code, appearing everywhere except author pages [on hold]

I've got some custom loop code which I'm using to modify the way posts are output under Genesis (using Foodie Pro child theme), to insert some sharing icons using a Shareaholic shortcode. The problem ...
0
votes
0answers
11 views

syntax error iN paid theme [closed]

When I have add a function in my paid avada theme. it is showing me error syntax error, unexpected '<' in /home2/markbeat/public_html/etsypromo.com/wp-content/themes/Avada/functions.php on line ...
1
vote
0answers
29 views

check if author has published posts in custom post type, then send mail

I have a site where people can submit drafts to a custom post type from the frontend. Once a user submits the form, a new WP user is created. If the user is logged in the submitted user e-mail ...
0
votes
0answers
8 views

A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control

Are you familiar with the Customizer core $wp_customize->get_setting( 'header_textcolor' )? It will become available once you add_theme_support( 'custom-header' ). It have two controls, one is a ...
0
votes
3answers
136 views
+100

Show media-uploads to all users

I want my media-library and all currently uploaded files distributed and available to all users. I am using the User Role Editor Plugin Is there any functions.php hack that makes all media-uploads ...
-1
votes
0answers
16 views

Call Woo order id and total into tracking script in head? [closed]

I am not asking for much, I don't think... That being said, I simply need to know how to call a Woo Order number and order total into the script that sits in the head of the order completed page. ...
0
votes
0answers
3 views

Set the transport of the Customizer 'header_image' core setting to 'postMessage'

To activate the Customizer core section Navigation (ID: nav), you need to: add_theme_support( 'custom-header' ); I already tried to make the transport of the Customizer header_image setting ...
4
votes
1answer
63 views

wp_set_object_terms and arrays

I need to add a category to about 2500 posts, and either need to use an SQL query or wp_set_object_terms with PHP. I'm looking at wp_set_object_terms so I can add a category and not impact the ...
1
vote
1answer
34 views

Where in PHP do I move title and meta (date) to bottom of each blog section?

I'm working on a Divi site that has two blog grids on the home page. I need to move the title and the date of each blog section to the bottom (below the blog text). <div ...
0
votes
0answers
22 views

How to select a template for displaying custom post type

Hi i know how to implement post types list in any page or template in worpress using code . for example $args = array( 'post_type' => 'home_banner'); $loop = new WP_Query( $args ); while ( ...
0
votes
1answer
17 views

How to set default archive image without overriding first attached image?

I have hit a wall. I have archive pages with some posts that have featured images which display fine. Some posts don't have featured images but the first attached image displays. Some posts have no ...
0
votes
0answers
17 views

How To Dequeue Styles From Plugins With “if”

I'm not a coder, but I'm trying hard enough to optimize my site using free codes. Lately, I found a way how to dequeue and deregister script/styles from plugins. Been using this: add_action( ...
0
votes
0answers
34 views

WordPress SEO By Yoast Plugin is interfering with a custom function code - how to troubleshoot and fix it?

I'm trying to optimize my page load on my WP site. I've copied a custom function (can't remember where I pulled it from) to optimize my pages. Things that it can are the following: move javascript ...
0
votes
0answers
24 views

Why wont these thumbnails show up?

Here is a link to the Website with the issue. http://southernhighlands.com/homes/exclusive-listings/ Looking at the 1st thumbnail I can see it is linked to Notice: Removed http:// because I can ...
0
votes
1answer
25 views

Dynamically generated Navigation Diagram using Custom Fields

I am attempting to dynamically generate a Navigation Diagram (as seen at http://zinderlaw.indigo-grove.com) that uses custom fields on the page to fill in the href tags of the imagemap. I am not ...
0
votes
2answers
29 views

White screen error for a custom theme

I have created a theme for one of our clients using bootstrap framework! When i was working on it on Localhost it works Correctly, but when I Uploaded it doesn't work. When I Activate it from ...
0
votes
1answer
21 views

Weird Behaviour: Not all Wordpress Posts appearing

My wordpress posts have vanished on my dashboard but remain in the database? Meaning I have many 404 errors. All (52) | Published (4) | Drafts (7) | Trash (2) TOTAL =11 items (Note how theres only ...
0
votes
1answer
14 views

Published custom posts missing

On my wordpress dashboard I noticed a large number of past posts were missing. All (708) | Published (386) | Drafts (17) | Pending (8) | Private (1) | Trash (3) - Total 412 Our items are custom ...
0
votes
1answer
13 views

Functions when woocommerce isn't installed

I'm working on a theme right now and I'm using some functions like is_shop() in the header if the woocommerce plugin is installed. However when the plugin isn't installed these functions aren't ...
0
votes
0answers
20 views

Split posts into separate screen on custom post type admin screen

I have a custom post type called 'event' that has a meta_key of event_status with a value of either 'upcoming' or 'past' depending on the event date. I am trying to split all past events into their ...
0
votes
1answer
34 views

Enabling shortcodes for custom fields

So, in this post it is explained how to supposedly enable shortcodes for custom fields in Wordpress. (Shortcodes are not enabled for custom fields by default.) What I dont understand is where to ...
0
votes
0answers
24 views

Child Theme functions.php has no effect

I'm trying to make a child theme of Woothemes Appply theme. The Child functions.php file is having no affect though. I started by adding in the code to enqueue a style sheet, which didn't work. Then ...
1
vote
1answer
39 views

Issue adding text after short description on product pages Woocommerce

I am trying to add some text after the short description on woocommerce. I have come up with the following add action but when I use it, it replaces the existing short description text. Is there a ...
0
votes
1answer
22 views

Hook into install email

I created a plugin that makes use of the wp_install method (this part is necessary for the plugin to work properly and this function needs to be called). http://wpseek.com/function/wp_install/ ...
1
vote
3answers
37 views

PHP files included in functions.php don't seem to work

This is my first post on WordPress StackExchange, I'll try to be precise. My question is: Is there anything in particular I should do to the files I'm including in my theme's functions.php file? ...
-1
votes
0answers
19 views

Using functions in ACF save fields not working

So I built a form based off of the fields that are made by the Advance Custom Fields plugin but doing anything with the field in regards to validation has caused issues. The issues will usually have ...
1
vote
1answer
33 views

Programmatically set page template based on page ID

How would I set the page template based on the ID? I have Redux Framework installed in my site and one of the options is to set a registration page. On this page, I want to use a specific template, ...
2
votes
1answer
27 views

Keep a fluid max number of posts on site

I'm trying to figure out how to set the max number of posts allowed across the site, but keep it fluid by sending old posts to the bin when a new post is over the limit. (I'm trying to stop the ...
0
votes
2answers
27 views

esc_url( ) won't use https

The code on the page looks like this: if ( ! empty( $image ) ) : ?> <div class="headshot"> <img src="<?php echo esc_url( $image ); ?>" alt="Photo of <?php echo esc_attr( ...
0
votes
0answers
14 views

I wan to process the following js to process the AJAX Request on my function to calculate author Total Post views

This is my Ajax Handler function function get_total_post(user_ID) { jQuery.ajax({ type: 'post', url: ajaxforall.ajaxurl, cache: false, data: { action: ...
0
votes
0answers
15 views

Cannot disable wpauto

I have tried everything to disable something adding multiple paragraph and break tags (up to 20 in a row) tags to a registration form. I first went into the event espresso files for this plugin and ...
0
votes
0answers
19 views

Adding some sort of Label-text to a looped button

To sum up my problem, here's a picture: I've added this text with a hover-fx to a button to explain to users what the button does. I've done so by adding a <div> with another <a>-element ...
0
votes
0answers
15 views

Manually call a WP class, e.g. wp-comments-list-table?

How would I output a class such as the admin comments table (wp-comments-list-table.php) on my own page? Thanks in advance
2
votes
1answer
40 views

Setting cookies in Wordpress

I am trying to set a cookie on my site and wanna switch the style sheets using this cookie. I've tested a normal function but it does not work. I've put below code into my functions.php ...
0
votes
1answer
52 views

Shortcode display outside the div

I have created a shortcode that retrives and displays a form.The content of the attribute in HTML. function check_my_login( $atts) { return '<form action="" name="" method="post" ...
0
votes
1answer
41 views

Change Slug of a Custom Post Type

I use a plugin that creates a custom post type with a slug that I am wanting to change. I don't want to overwrite the plugin files, so I'm wondering how I can change the slug using a separate ...
0
votes
0answers
41 views

Setting a cookie in functions.php and it gets deleted when working on an other function

My first function gets the parameters from the URL and sets the cookies: /** Get variables from the URL and set them into the coockie **/ add_action( 'init', 'set_utm_cookie'); function ...
0
votes
0answers
23 views

Using Conditional Themes to change out different themes using the Theme Customizer radio Buttons

I've been trying to change my theme based upon a radio button selection from the theme Customizer. I've included this plugin -> https://wordpress.org/support/plugin/wp-conditional-themes as a file ...
0
votes
1answer
82 views

Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS

I've been having trouble Automatically Compiling my .scss files into my main WordPress style.css file. I'm using Leafo's SCSSPHP script and trying to achieve a few things. i'm using Kirki ...
0
votes
1answer
53 views

How to pass variables from a function in functions.php to an other one

I have a function that gets the variables from the URL (UTM): /** Get Parameters From UTM **/ add_action('template_redirect', 'get_the_utm_vars'); // 'template_redirect' - action hook that ...