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
23 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
27 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
34 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
37 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
39 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
77 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 'admin.php?...
0
votes
0answers
43 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
74 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
56 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
53 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
24 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 href="#...
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
73 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
18 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
48 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
28 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
59 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
42 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
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
64 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
156 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
28 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
11 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
20 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
38 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 = get_posts('post_type=posts&posts_per_page=3');//...
0
votes
0answers
22 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
23 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
23 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
35 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 ...
0
votes
0answers
38 views

Call attributes from shortcode function to a JavaScript function?

How do I call attributes from shortcode function to a JavaScript function? extract(shortcode_atts( array( 'xyz' => '' ), $atts )); I want to call xyz's value in ...
0
votes
0answers
37 views

Add action after function defined in plugin

I'm trying to write my second ever plugin (my first was a derivative of Hello Dolly) and I have a function that does something, however my issue is that I don't know what action to use to call my ...
0
votes
0answers
169 views

Custom taxonomy not refreshing page on add

I have created a custom taxonomy for use with WP Job Manager. The taxonomy shows up, however when I type in my tag and click the "add new job title" button nothing seems to happen. If I click refresh ...
0
votes
0answers
31 views

How to let users “follow/subscribe” tags (part is working)

I've searched for this for a looong time; My users should be able to follow/subscribe a tag than on a second front page, they only get posts from the subscribed tags. In the following example, in the ...
0
votes
0answers
149 views

500 error even after restoring to a working functions.php

While changing the functions.php file to edit who can see the wordpress toolbar I managed to return a server 500 error after the page as updating. I've since restored my backup of the previously ...
0
votes
0answers
52 views

Add Title Field To User Profile Page

Looking to add a title field to user profile which is shown above First Name field. I can add custom fields using this code but I can't figure out how to change the position of the title field to ...
0
votes
0answers
50 views

is_page_template wont allow me to enqueue scripts

I want to load specific javascript files onto any page that uses the template hello-world.php below is the code that I have used to target the page, register and enqueue scripts. But for some unknown ...
0
votes
0answers
31 views

Is it necessary to add function.php into index.php

i am new to wordpress.. I want to add 3 different js files in index.php for this ..i have following code function.php <?php function addjs() { $dir = get_template_directory_uri(); ...
0
votes
0answers
29 views

Simple modification for menu structure

I'm trying to make a menu for my website, but I want it to be easily modified through original WP menu(dashboard > appearance > menus). I want to add some small thing to the structure of my menu, ...
0
votes
0answers
38 views

Why isn't my plugin seeing other classes?

I've written some very simple code based off of this tutorial by Harish Chouhan on the Plugins API: /** Add Plugins API if not already existing */ if ( ! function_exists( 'plugins_api' ) ) ...
0
votes
0answers
50 views

How to retrieve value from Gravity Forms input and put it in template?

I'm trying to retrieve and input from my Gravity Forms form and put it into a template file. I know I have to use gform_after_submission but I am not sure what I am doing. This is what I have so far: ...
0
votes
0answers
14 views

How to get all the posts to a image (media)?

I would like to fetch all the posts in which a particular image is used. Lets say image_xya.jpg is attached in following articles- Article 1 Article 2 Article 3 Now I would like to display all ...
0
votes
0answers
21 views

Need some Tweak my nextpage Function

How I can get the next post URL when I'm on the last page ? e.g. I want go to the nextpost when i'm on the last page... This code need some tweak... Here is my Function: function next_page( $i ) { ...
0
votes
0answers
33 views

Login with user in custom created table

I was trying to add more features in login page, that i created a extra "myusers" table and trying to add two tabs in login screen,with the second tab i want login using my created users in 'myusers' ...
0
votes
0answers
17 views

How do I display continuous loop of multiple (4) previous adjacent posts while viewing the current post

I found a great article that enables me to display previous 4 adjacent posts here: Getting the Next and Previous Posts Titles in the Sidebar? @sorich87's explanation works great for me on my website. ...
0
votes
0answers
35 views

wp_delete_comment is doing nothing

I'm using front page delete links for users to delete their own posts and comments. The links are generated on the page like this : <a href="#" data-id="<?php the_ID() ?>" data-nonce="<?...
0
votes
0answers
274 views

Image rotation issue (horizontal picture uploading as vertical) — Exif issue?

I am building a classifieds site on WordPress where users can upload their ads/images from front-end. However, when horizontal pictures are uploaded, they upload as vertical. I looked into the issue ...
0
votes
0answers
24 views

weird redirect from Movable Type installation

I'm helping a friend moving his blog from MT to wordpress, in order to do so I have created a truth table on the database (rosetta) by looking at all the old static files and I've created a relation ...
0
votes
0answers
18 views

Intercept an image before it's uploaded to Media Library

I've got a WordPress website where I need to have some posts with gifs as thumbnails. After researching this topic a bit I realized that I have to intercept the gif before it's passed into Media ...
0
votes
0answers
66 views

How to wrap all elements in a div inside a post

How to wrap all elements in a div inside a post? eg <p>...</p> <h1>...</h1> <img> turns to <div class="para"><p>...</p></div> <div class="...