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

Get specific post connections

So I'm using post2post plugin to create connections between posts. On my functions.php I try to get specific post connections but I don't get the connections and I'm not sure why. Any help? So far my ...
0
votes
2answers
19 views

Can I use a function to return HTML and the result of another function?

I have a very simple function to create a shortcode to get the name of my page. I was using this shortcode in a form, but WordPress changed the Shortcode API and that no longer works. So I was ...
2
votes
3answers
45 views

How do I replace a function, declared inside a plugin's class, in functions.php?

I want to modify a function in a plugin. It is declared in the plugin's main file like this: class WCPGSK_Main { ... public function wcpgsk_email_after_order_table($order) { ... } } Add ...
0
votes
2answers
31 views

Show parent-child relationship for categories in the wordpress admin

How can I show child categories under there parent category in the wordpress admin? On a post the format of the category box would look like this: Category 1 Sub-Category 1.1 Sub-Category 1.2 ...
0
votes
0answers
10 views

Pre_get_posts meta query value serialized array using multiple URL parameters

Using the 'pre_get_posts' action I'm looking to return all posts which match multiple URL parameters by defining the meta_query. For example: example.com/?size=large,small&options=green,blue,red ...
0
votes
2answers
39 views

Most elegant way to enqueue scripts in function.php with foreach loop

I wonder is there a way of running wp_register_script and enqueue with the help of foreach loop to manage label and dir? For example, function wbs_app_components(){ $scripts_list=array( ...
0
votes
1answer
18 views

Hook for altering the content of all wp mails

Hi i want to set email template for all mails for my site . I know how to set up mail template and i set mail template for each of my mail by editing the code ie wp_mail( $recipient, $subject, ...
1
vote
2answers
27 views

Get date numerical and separate?

I need to work with date function but I want to get day and month numerical and separate and pass it to a function. For example, I want work for this function. function(day,month) How can I ...
0
votes
1answer
20 views

Removing parent theme CSS without editing parent theme

I am currently developing a child theme that builds on twentyfifteen as a parent theme. However a potential issue has cropped up that is causing a problem. I want to strip the CSS and JS assets from ...
0
votes
1answer
33 views

If user is logged-in display/hide something

I want to check at page load if the user is logged in or not and hide the login mask I programmed accordingly. There is a reason I'm using said login mask instead of redirecting to the WordPress ...
0
votes
1answer
20 views

Send post changes to set email addresses (not users or subscribers)

What I have I am using the "The Events Calendar" plugin on my site to coordinate a team of employees. I want to be able to send an automated email containing the body of an event post (post-type is ...
0
votes
0answers
12 views

Taxonomy Term Variable within Foreach Loop

I have a foreach loop that cycles through all the terms of a specified taxonomy (product_cat in this case). I have the terms in a variable called $productTerm but I cannot get it work in one section ...
0
votes
0answers
20 views

Change login and not login into user role

I need help, I'm sitting in front of my computer for days, i think i need help in editing the user role, just the user role, the rest of the code works. I have tried sevelral code, get current user, ...
0
votes
1answer
43 views

How to pass a variable from a template page to the child theme functions.php

I'm searching for a way to pass a variable from a custom Wordpress page template to my child theme functions.php file. I have the wrong scope and I'm completely lost. I'm trying to generate a google ...
0
votes
1answer
26 views

Instead of using $post, how do i get the thumbnail image of the $post

Instead of using $post, how do i get the thumbnail image of the $post I tried using: $post->link $post->ID $post->pw_link_target $post->image_link $post ->image_id ...
-3
votes
1answer
21 views

I need social icons on each post

I would like to have social media buttons for Facebook, Twitter, Google+, E-mail, LinkedIn and Whatsapp on each post, authors must be able to select which social media icons have to be displayed and ...
0
votes
2answers
39 views

What is the correct way to include my new functions and scripts in WordPress?

To include new functions we can write them in the theme's functions.php. But I have to write my own functions in a new file rather altering the theme's function.php. I can write any custom js action ...
0
votes
0answers
18 views

Bootstrap Drop Down menu is not working

Bootstrap dropdown is working when i added the jquery( https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js ) in footer and by deregistering wodpress default jquery. When i disabling the ...
0
votes
0answers
14 views

Changing time format beyond normal customization [migrated]

We all know we can customize the time format for Wordpress using basic customizations as outlined here: https://codex.wordpress.org/Formatting_Date_and_Time But, in order to match the styleguide a ...
1
vote
1answer
34 views

is_user_logged_in not working to redirect only logged out users

So I have the code below in my functions.php file. It works for logged out users but it also redirects users that are logged in. Can anyone help? add_action( 'template_redirect', ...
0
votes
0answers
15 views

I wanted to restrict a user role, only user role “contributor” can access/view a specific product categories, not the post type post category

after reading this article:Add role that restricts user to post in specific category, I try to edit the function code in my theme but it doesn't work, maybe I'm missing something here a small detail ...
1
vote
1answer
34 views

Display posts from only one post form in custom query and exclude in main query

I am trying to first display four posts with post-format-aside (all assigned to current tag) and then display the "real" archive (exclude post-format-aside) for the specific tag. Right now I am using ...
0
votes
1answer
25 views

Page returning ID from array, how to return the correct values for post in acf wordpress

Im having a little trouble returning the correct value with the relationship field. My end result is to use the relationship field to add selected locations to a drop down in gravity forms. I can ...
-1
votes
0answers
16 views

Is there a way to shared product category taxonomy into post category in backend?

Is there a way to shared product category taxonomy into post category in backend? I have tried this method: woocommerce/includes/class-wc-post-types.php Line 51, you'll change from apply_filters( ...
0
votes
0answers
11 views

Use function in stylesheet [duplicate]

I have an Advanced Custom Fields plugin. With ACF I made a colorpicker for every page. I want the color to load in the stylesheet, but this doesn't work the way I want. This is what I have now: ...
0
votes
0answers
48 views

Visual Composer creating own shortcodes with vc_map() to return simple Image

I am using the Plugin Visual Composer with in a new Theme I develop. My question is about mapping shortcodes to Visual Composer arrays. The problem I get, when I try to make a custom element for an ...
0
votes
1answer
30 views

Login functions

Where are the functions that handle logging the user in? Specifically, the one that checks the users plain text password at the login page against the hashed formatted one stored in the database?
0
votes
0answers
22 views

add_filter Add To Content, Not Replace Existing Filter Function Content

If I am trying to add content to the content generated by a plugin/core filter function - how is this accomplished? The specific situation I am attempting to accomplish - I want to add the widget ID ...
0
votes
1answer
20 views

How can I see a varibles value when my plugin runs?

I am trying to make a plugin that redirects a user based on how they fill out a form. I am having trouble finding my problem I have narrowed it down to a small snippet that seems to work. function ...
1
vote
1answer
27 views

override pluggable.php functions

I just not only want to override a pluggable function (wp_new_user_notification) but I want to make sure that if any other plugin is overriding the same function, so my function , override that too or ...
-1
votes
1answer
36 views

Create new WooCommerce product (PHP) after submit form [SOLVED] [closed]

EDIT: You'll find my own solution at the bottom, on a new answer I have a website where the user uploads a file, then I calculate the price for whatever I do with his file and then they pay for it if ...
0
votes
2answers
28 views

Home/Static Page View for Visitors pages after that should be restricted

Is there a plugin or a function code I can use to restrict pages except the home/static page to my visitors? I want my visitor to view Home/Static Page ONLY and if they click to older posts (page 2 ...
0
votes
0answers
38 views

Editor Styles Not Working

I am trying to re-style the TinyMCE editor here: http://dannymcgee.net/duskguard/forums/forum/general-discussion/ I've tried both of these in my functions.php: add_editor_style(); or ...
0
votes
1answer
19 views

functions.php filters not applied in AJAX call

I've added an element to a menu with php (code simplified for illustrational purposes): add_filter( 'wp_nav_menu_' . $menu_slug . '_items', 'add_menu_item' , 10, 2 ); function add_menu_item ( $items ...
0
votes
0answers
12 views

Theme Customizer not recognizing Widgets

First of - i do not know much coding, though i do learn quickly and am looking to get this issue sorted ASAP. I am sure it is something simple. When i load up my site in the Wordpress Theme ...
0
votes
0answers
21 views

Automatic Logout on from another active session

I have a made application over Wordpress for premium user where user can see page after logging into his account. but there is issue that same user can login form multiple computer, so I want to make ...
0
votes
0answers
49 views

echo value from 'select' field type into page template using cmb2?

I'm using CMB2 plugin to add metaboxes into a custom post type. I'm adding the additional metaboxes via functions.php onto child theme. It may worth to mention that parent theme/custom post already ...
0
votes
0answers
20 views

wordpress not calling peliegro functions.php?

I'm very confused with this question because I'm not really sure what is happenning, but as far as I know, my "father" functions.php is not being called. I'm using peliegro and peliegro Child. What I ...
0
votes
0answers
13 views

Php function modifying the page's rendering engine buffer and blocking caching plugin

I tried to create a plugin which creates pages based on a CSV or excel file containing hundreds of city names and postal codes. It creates one page per city, with always the same design but different ...
1
vote
2answers
34 views

WP Query. Is there a maximum size?

I develop a plugin that searches for a duplicates of WooCommerce products in a very specific way. It works great in our test environment, but on the client's original setup it does not execute. It ...
0
votes
1answer
37 views

Use WP_Query Data In Cookie

I've collected an array and set-up a cookie via functions.php, both work fine. However, I really need to post the data to the function and set the cookie as this information will vary per customer. ...
0
votes
1answer
30 views

two search forms on the same page

I have a mobile and a large screen search field. I am trying to load these both on the same page. I am using JointsWP Starter theme. Here are the functions: function joints_wpsearch($form) { $form ...
4
votes
1answer
84 views

How to not allow users to create new tags, but allow to them to use existing ones

I want a certain role to be able to add new tags, but other users should just be able to use the text bar to search for existing tags. I know I can hide the tag bar in the sidebar, but I don't want ...
0
votes
0answers
14 views

is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript

Is there a predefined JavaScript function that can be use to check whether the site is being previewed in the Customizer which returns true if it is or false if it's not, just like what ...
0
votes
1answer
27 views

Formatting post content to exclude gallery

I have this code which takes the first gallery for a post's content, and formats it with more code preparing it for slideshow usage with css and js. $gallery = get_post_gallery_images( $post ); ...
0
votes
1answer
22 views

how to create table during plugin installation in side a class

I am creating oop base plugin. So how to create table during plugin installation in side a class.But I could not create table. This is my approach.What wrong with me. class Notification { ...
0
votes
0answers
23 views

does it need any special functions to write in function.php?

does it need any special functions to write in function.php of template for single-{post_type}.php? I created a custom theme , but it does not move the single-{post_type.php}, my page is ...
0
votes
0answers
13 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
27 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
1answer
138 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 ...