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

Hide pages + widget edit

I have 2 questions on this site i have this item i was wondering how can I make this item not show in the widget area or any other part of the site but still be accessible if some1 has the link to it ...
0
votes
2answers
37 views

Ajax not working to insert, query and result data

On my site, through a form I send/register same information in database, do a SELECT/query and return it! Return the last table saved in database, just that user just entered on the form (along with ...
1
vote
1answer
940 views

Remove Header and Footer in iframe

Many people embed my website's pages in their websites as iframes. I want them to don't take my footer, header and a specific division in those iframes. Since, footer, header and mentioned specific ...
0
votes
1answer
13 views

Custom post type in Custom widget - $listItem

Hi i have a slight problem when making a custom post type widget. the problem is that when i add a custom field in the code the part that shows the custom field information get's on top of the output ...
0
votes
1answer
13 views

ACF in wordpress

Hi i have a slight problem when making a custom post type widget. The problem is that when i want to get the field i want to use in a inline style it doesn't work. This is my code: class ...
-1
votes
0answers
16 views

How to hook for disabling sending processing order email notification if order total value is 0 - Woocommerce?

I need to disable woocommerce sending processing order email notification if order total value is 0. I also tried: : add_action( 'woocommerce_email', 'unhook_those_pesky_emails' ); function ...
-3
votes
0answers
24 views

error in a php snippet: is_checkout() [on hold]

I am seeing a new error in a snippet I've been using successfully (until recently). Something in this line is off... if ( ! is_checkout() || ( is_checkout() && WC()->cart->...
0
votes
1answer
34 views

Shortcode to eliminate <p> and replace </p> with <br>

I have a filter that removes opening p tags and replaces closing p tags with a br tag sitewide. The client would like this filter in a shortcode that they can use only on specific portions of the site....
5
votes
2answers
8k views

Add custom template page programmatically

I'm trying to add template page from a plugin,and my template page is in this plugin folder.Is this posible?Here is my code: global $user_ID; $new_post = array( 'post_title' => 'Test ...
0
votes
1answer
2k views

Let users upload image(s) to the post from front end

I want to enable logged in users (Wordpress) to submit posts from front end (among with other data). My form is working great, I add custom post meta data which I later display on custom post page. ...
0
votes
0answers
9 views

Get a color name from any RGB combination (script included) [migrated]

i am returning a hex and an RGB color in my app (from camara) and i want to use a script to identify that color and display a name... ive found http://gauth.fr/2011/09/get-a-color-name-from-any-rgb-...
0
votes
1answer
17 views

No compression occurs on my jpegs after adding jpeg_quality hook to my functions.php file

I'm attempting to perform some basic jpeg compression by using the jpeg_quality hook inside my functions.php file but there is no compression/resizing taking place. I'm only measuring file compression ...
0
votes
0answers
25 views

Using external function() from functions.php

Does anyone know how to use a function() which is written in a plugin file... I want to call this function() from theme's functions.php.
0
votes
2answers
421 views

Use Exact Image Size using add_image_size

I have a pretty basic question. It may be very noob question, but it is bothering me a lot. In my theme I've added a custom image size like this: function img_update() { if ( function_exists( '...
0
votes
2answers
547 views

Possible to register multiple custom taxonomies in one function?

I'm registering 7 custom taxonomies in my functions.php. Since each function uses the same labels and arguments and is attached to the same Custom Post Type, I'm wondering if it's possible to register ...
-1
votes
0answers
16 views

How can I echo the latest time a Product was updated (Woocommerce)?

I would like to print out when the product was last updated, as I sell online courses. Any idea on how to implement this as a shortcode?
0
votes
2answers
677 views

Show the post date using the wp_get_archives() function?

I have some doubt about the wp_get_archives() function In my website I have create the following page template that use the wp_get_archives() function to show the posts list: <?php /** ...
0
votes
1answer
20 views

Issues separating my Plugin pages into different files

As my last (first) plugin got a bit hard to manage with 6 admin pages in 1 file, I decided to split them up for this one, but I am getting nothing but issues doing so. In my plugins functions file (...
0
votes
0answers
14 views

How to call a function declared in post.php

I have created a function which checks the post meta data of the post and then chooses a particular category for the post. The function is working fine. I have declared it inside post.php. I want this ...
0
votes
0answers
30 views

Wordpress theme not show php correctly

On my server i got an updated version of WP, with a working theme. I just made a new one. The problem is that when i activate it, (or just preview it, via customize) it doesen't render php script. ...
2
votes
4answers
6k views

redirect wp-login.php to another page

I would like to redirect this page wp-login.php to /login page. So when a user clicks on a link like this <a href="/wp-login.php">login</a>, wordpress will redirect him to /register . I ...
5
votes
4answers
214 views

Does My Child-Theme Functions.php Need if{die} Security In It?

I'm new to PHP, but I've noticed just about every PHP file has a security snippet, "Die if not accessed in the correct manner" script at the beginning; my question, does a child-theme functions.php ...
0
votes
1answer
39 views

How i can put $_GET codes in function.php?

if(isset($_GET["link"])){ $link = $_GET["link"]; header("Location $link"); } this my redirection codes. i put this code in function.php but not working. Example link: http://localhost/?link=http://...
2
votes
3answers
2k views

How to display post tags

I'm converting an HTML template into a wordpress theme and I'm having some trouble displaying the post tags within the functions.php file. What I would like to do is add the following code into the ...
0
votes
1answer
13 views

Automatic add space if user enters number(any digit)

I have one input field in that I need to check that if user enters any digit then it automatic add spaces i.e. When someone enter a phone number like 0499287909 then in string should change the ...
-2
votes
1answer
31 views

get_template_directory_uri pointing to parent theme not child theme

The problem I am having is that the get_template_directory_uri is pointing to the parent theme like site/wp-content/themes/twentythirteen/myGallery/gallery_functions_include.php but I want it to ...
1
vote
1answer
980 views

Auto Populate Custom Field with Complex Value That Increase by One?

Can somebody help me to sort this? I am using WP 3.5.2 and I have "Orders" post type where purchase_order custom field is located. This is the sample of purchase order record: POCOS20130051 PO - ...
-3
votes
0answers
22 views

Woocommerce Free Shipping [closed]

I would like to set free shipping at say order value of $100, however there are products in 2 categories that are significantly heavier and such if these items are on an order I would like the free ...
0
votes
1answer
28 views

unnecessary request call for js and css after calling wp_dequeue_script

called unnecessary js and css request http://www.example.com/wp-content/plugins/includes/js/jquery.form.min.js http://www.example.com/wp-content/plugins/includes/js/scripts.js orignal it was http:/...
0
votes
2answers
483 views

How to create an option page for this simple plugin

I know how to write WordPress plugins but I have no idea how we could create an option page for our plugin. I have read lot of tutorials but I still have no idea about creating option pages. So just ...
0
votes
0answers
14 views

Using the function of wordpress in the director on another folder

In the public_html I have installed my wordpress there, the folder wp-content wp-admin were there I'm thinking if I have another folder called 'test-folder' and I have a file there which is test.php ...
0
votes
1answer
20 views

child parent styles enqueue order

I have a wordpress theme which I hacked to my specifications. I know I'm not supposed to do that but it was long ago so now I'm trying to implement a child theme and I've put those revisions into the ...
0
votes
1answer
38 views

How to remove admin footer text from inside child theme?

I am using this set of functions in child theme to remove unneeded footer info: add_filter( 'admin_footer_text', '__return_empty_string', 11 ); add_filter( 'update_footer', '__return_empty_string', ...
0
votes
1answer
22 views

Changing the register url is not working

I have this in my functions.php // Change Register URL add_filter( 'register_url', 'my_register_page' ); function my_register_page( $register_url ) { return home_url( '/join/' ); }...
0
votes
1answer
21 views

Limit Taxonomy Output in Conditional Statement

I am trying to limit the amount of category tags I output to 5 as well as append a "..." to the end of any items where the output was limited. I've got it mostly working except I can't figure out how ...
0
votes
0answers
14 views

When a user logs in, how can they view the website instead of the admin menu?

I added Login/Logout buttons through a function: // Add Login/Logout to Menu function add_loginout_link( $items, $args ) { if (is_user_logged_in() && $args->theme_location == '...
1
vote
0answers
32 views

Move jQuery and Migrate to footer?

I've seen this answer, but I'd like to move Migrate as well. I'm trying to move both jQuery and Migrate to the footer and change the jQuery to the CDN version. Here is the failed code I've tried (Why ...
-1
votes
1answer
34 views

Why functions metaboxes is causing White Screen in Admin [closed]

I am having an issue after migrating a project to other server. When I go to /wp-admin I am getting a 'White Screen of Death'. If I access to /wp-login.php instead I get the login form but with an ...
0
votes
0answers
31 views

Display most popular in the past two days

Hi I'm using this code below to display the most popular post on my wordpress site. It works great! I was wondering if there was anyway to show the most popular post of the current day? This in my ...
1
vote
1answer
812 views

Using add_filter() in Widgets

Just have a query reference the add_filter() function. Can you use this function inside a WordPress widget class. Example I have a widget with dynamic created code that I want to pass to another ...
0
votes
1answer
22 views

Run function when WordPress new multisite is created or ACF field is updated

I have created a function on the main site in my multisite network that loops through each site in the network, pulls the values from their options page in ACF, and saves the data to a JSON file. ...
0
votes
0answers
37 views

jquery Load All Wordpress Post and Pages Into Div Using AJAX

Ok So I am working on my first Wordpress them based off html5 template that I created myself. Right Now On the site I have a continous music player. It allows the users to listen to music while ...
1
vote
1answer
28 views

Custom Static Links For Specific Menu Right Before/Next The wp_nav_menu Function now working

I am trying to add custom links next/before my built in menu, specifically for main_menu. I have placed this in my functions.php and have given list-items in nav-menu-after.php and also in the before ...
0
votes
1answer
35 views

Setting up the child theme so as to enable right-to-left WordPress?

I want to make a child theme for twentyfifteen theme in WordPress to show in right-to-left direction. I read the documentation on that in Codex. But to be honest, the documentation was good for a ...
0
votes
1answer
919 views

Add content after get_header

I'd like to add content directly after the div#main (end of header.php) and before /div#main (beginning of footer.php). I'm using an own child-template (of twentythirteen), that contains only style....
0
votes
0answers
26 views

Passing Persian characters to wp_localize_script string is utf8 encoded

I am trying to pass some data to my front end page using wp_localize_script in Wordpress but the return value is somehow UTF8 encoded! How can I prevent this action or decode the content when I need ...
0
votes
1answer
828 views

How to add nav menu items to a specific position within a menu

I'm adding login/logout links to a nav menu using the following code: function rp_add_login_logout_links( $items, $args ) { $link = wp_loginout( get_permalink( get_option( '...