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

How do I customize my wordpress Admin Area?

I'm building a wordpress multisite which is aimed to serve as a blogging platform but I wanted to customize the admin area for my users by removing all the dafult widget. Please , Is there a wordpress ...
0
votes
0answers
10 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
21 views

Display 3 more recent / current / 3 less recent posts in category

What I'd like to display is: 3 posts more recent | current post | 3 posts less recent and be able to give this function a category, like (99), so it wouldn't be just 3 more recent posts published, ...
0
votes
1answer
19 views

enqueue multiple Google fonts with multiple weights and styles (italic).

I am trying to enqueue multiple Google fonts with multiple weights (400,600,700, etc,) and styles (normal, italic) and can't figure out why it is not working. This is the code that I am using in the ...
0
votes
0answers
28 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
1answer
26 views

Allow authors to post only in categories they create in WordPress

I'm looking for a way to allow users with an assigned WordPress role (in my case, author) to create new categories and then automatically be restricted to only posting in those categories or the ...
0
votes
0answers
23 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>'; ...
-4
votes
0answers
20 views

i have a problem with the responsivity of my site [on hold]

i have a problem with a site i built www.hadran.co.il, the site looks good but in the phone it looks very bad. its go left and many more problem, can anybody can go to the page threw the phone and ...
-1
votes
1answer
25 views

Sync roles across several plugins

Here is the setup: I am implementing Wordpress with two specific plugins: Ultimate Members and Yith Vendors which is a woocommece addon. What I need to do is change a field's data in the database ...
0
votes
0answers
24 views

Warning Error When Visiting My Site

When some people visit my eCommerce site, they get this error: This is what it keeps saying: Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'wp_widgets_init' not ...
0
votes
0answers
11 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 ...
1
vote
0answers
12 views

Create a Button alongside add to cart

i want to create a button alongwith add to cart that will perform a specific function. please tell me how to do this.Also can you tell me the css of this button so that the button looks exactly like ...
-1
votes
0answers
29 views

Custom Theme Admin contact-form config page won't display

I'm stuck. I'm trying to add a contact form section in my theme admin. I have added: the functions <?php /* @package volcanotheme ======================== ADMIN PAGE ...
0
votes
0answers
20 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
13 views

How to use wordpress (php) functions in angularjs partials files?

I am using angularjs to load a list of my wordpress posts, however I can not get any of my php functions to work with my partials file. I've tried using something such as search.php instead of ...
0
votes
1answer
36 views

Check if has any sidebar active on current page

Is possible to check if has any sidebar active on current page? Like this: @edit This function also return true even if the current page does not have this sidebar active... <?php ...
0
votes
0answers
22 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 ...
1
vote
1answer
37 views

IF Statement in Wordpress

I can't seem how to correctly use the php if statemnt in my add filter function below. This code works perfectly if all (3) of my $_POST inputs have values however it has a fatal error if any are ...
0
votes
0answers
28 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
1answer
18 views

Displaying text if post was within 5 hours

Currently I have the following string. $timeago = human_time_diff( get_the_time('U'), current_time('timestamp') ); print $timeago; This returns results that looks like this. 1 min, 1 hour, 1 week, ...
0
votes
0answers
18 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 ...
4
votes
1answer
36 views

Paged Single Post doesn't redirect to the main url after Removing Pagination

I used <!--nextpage--> (Codex) to paginate (split) a few single posts. Now i removed all the nextpage html parts from the posts. everthing looks fine. Unfortunately the old urls like ...
0
votes
0answers
16 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 ...
-1
votes
0answers
19 views

Modify (functions) code that inserts ads (or whatever else) [on hold]

I use the following code in functions.php to insert an ad after the second paragraph. I would like to continue to do this, but also add another (different) ad before the last paragraph. How do you ...
0
votes
0answers
37 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 ...
1
vote
2answers
27 views

Change size and crop medium_large images

I use events manager pro plugin to show an eventslist. These event-list is showing their thumbnail image in the new (wordpress 4.4) wordpress image size "medium_large" (width 768px). I need an image ...
1
vote
1answer
33 views

Check if page parent has certain template

I want to check if a page has a parent with a certain page template attached to it. If I know that I can determine which scripts to load or not. Normally I would just get the page template and if it ...
0
votes
0answers
22 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 ...
-2
votes
0answers
16 views

How to get Fpdf,html2pdf or Dompdf get work in Wordpress custom template?

Im working on a project to let html input change into a pdf file. I know that are these working pdf programms, but how do i put it in Wordpress and let it work in there?
3
votes
1answer
35 views

Add options to featured image

I want to add an option to the featured image metabox. I have found a way to do this here The problem I'm having is saving the value tot the database. Here is what I have tried: add_filter( ...
1
vote
1answer
28 views

Creating loop within functions.php

I'm using Woocommerce on my website, on the checkout page I've got a custom select checkout field with radio buttons. I'm using this working snippet within my functions.php: /** * Add the field to ...
1
vote
1answer
29 views

How do I remove the date and category form my portfolio pages

This is one of my portfolio page Whenever I wanted to remove dates and category from blog posts I always used this code function jl_remove_post_dates() { add_filter('the_date', ...
1
vote
0answers
11 views

Adding a widget function into the php theme file

I am using the following plugin - widget No Cache AJAX Widgets to display on the sidebar a feed of rss news that is created dynamically and bypassing the cache function. In updating the site we wish ...
3
votes
1answer
31 views

Wrap each shortcode in array to div

i'm trying to wrap each shortcode in div with special data attributes, but when i'm using nested shortcode they don't wrapped, where i'm wrong? thanks public function wrapShortcode( $content ) { ...
-1
votes
0answers
20 views

Woocommerce Layered nav filter attributes not being included in a search by a custom field

I have extended the search to include custom fields on each product following guidance from this article: http://jamescollings.co.uk/blog/extending-woocommerce-search-query-include-custom-fields/ It ...
1
vote
1answer
19 views

Redirect to another page if the user is logged in when pressing again the login button on menu bar

So I have this button on the menu : "My account" that lets the user login on the website and as soon they log in they're redirect to their dashboard. What I'm trying to achieve is if he's logged in ...
0
votes
2answers
42 views

How do I correct the code in php? [closed]

I am new to PHP and I'm unable to solve the code. It's showing an error. <?php function thumbImg() { if ( has_post_thumbnail() ) { the_post_thumbnail( array(54,54) ); } else { ...
1
vote
1answer
28 views

Custom Shortcode, functions PHP WP_Query loop

I have the following code in my functions.php file:- function featured_properties_func( $atts ) { $args = array( 'posts_per_page'=> -1, 'post_type' => 'properties', ...
1
vote
0answers
16 views

Update user profile information from functions.php

I have the following function in my functions.php file:- function apply_for_job() { $job_id = $_GET['job_id']; $user_id = get_current_user_id(); $prev_value = get_field('applied_jobs'); ...
1
vote
0answers
12 views

Homepage's content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?

I have a custom field in my home page called "Featured posts". There are two fields: title and post. The post field returns post_object with post_type as posts. In my functions.php I have added the ...
1
vote
0answers
28 views

add_action shortcut?

I think in PHP 5.4 or above (don't remember the exact version), instead of writing: function some_function() { } add_action( 'init', 'some_function' ); One can pass an anonymous function: ...
0
votes
1answer
21 views

Limit dimensions of “Full” size images

Is there a way to limit the dimensions of the full size uploaded image (made normally through the Media library)? I have clients that upload huge images files with resolutions sometimes greater than ...
1
vote
0answers
10 views

Get First Child Page ID or Permalink in WordPress Admin

I have a navigation set where the content doesn't exist on the parent page, but rather on a page called Overview which is the first child of the parent. eg: About is the first level page, but when ...
1
vote
1answer
31 views

Override the function twentytwelve_scripts_styles in a child theme

I want to overide the function which enqueues scripts and styles in the theme Twenty Twelve using its child functions.php. I followed this guide but can't get it to work. Can someone suggest a ...
1
vote
1answer
18 views

Missing Argument

I have the following code in my functions.php to show a lightbox on the Simple Paypal Shopping Cart Plugin function make_wpspsc_thumbs_lightbox_previews( $thumbnail, $atts ) { // Code Credit: ...
0
votes
0answers
12 views

Multiple relationships pods issue

I'm new at using Pods, which I find very practical. I'm experiencing some issues though; I'd like to create a model like the following-one : Entity type 1 |->sub-entity type a, refers to a specific ...
2
votes
1answer
28 views

how to change link of some wordpress pages

I've made templates for the pages of my wordpress site such as: singup,signin,suggestions. Default wordpress pages link is as follows: doamin.com/signup/ or doamin.com/signin/ or ...
3
votes
1answer
64 views

Displaying post per day

Currently I have the code displayed below. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="col-lg-3 col-md-4 col-sm-6 col-xs-12"> <a ...
0
votes
1answer
32 views

Woocommerce checkout field maxlength, make input number field only (postcode)

I've been struggling with this for a few days now. What i want to do, it to limit the Postcode/zip fields to 4 numbers. So, to add a maxlength and a type="number" to those fields. Things i've tried ...
1
vote
0answers
26 views

Dynamically change feature image in customiser

For this client's Website I am making on their homepage there is a section called featured products with images showing off the product. Currently I have to update these images manually through my ...