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

How can I add recent posts to menu like mashable

I would like create a mega menu that uses recent posts for hover state. Like When you hover a submenu you get a list of recent post relevant to that menu item like in Mashable. I I would like a menu ...
0
votes
0answers
47 views

AJAX login without a plugin does not work. when add a action to function.php

I am using wordpress ajax login without a plugin. I want to not be allowed users access to the WordPress profile after login, Because i have designed a specific profile in the link: ...
0
votes
0answers
23 views

Create csv file in plugin

I have written a function to create csv file usin the below code.I am getting Headers already sent warning and I can't able to create the csv file too.How can I fix this problem.I have attached the ...
0
votes
0answers
8 views

Running wp_schedule_single_event on Post Import

I'm trying to have a category deleted after a certain length of time once a post has been published. I was successful in doing this when a post is manually created, but I cannot for the life of me ...
0
votes
0answers
18 views

Getting current user option within a function

I have created a new true/false field for specific user role "Member" to receive email notifications if a new post is published. For reference I'm using advanced custom fields to create a true/false ...
0
votes
0answers
32 views

Dynamically changing menu item link

Hoping someone can help me out - this has been driving me nuts for the past two hours. I'm trying to create a menu item - the menu URL should basically be: http://thesite.com/author/%username% ...
0
votes
0answers
15 views

Proper way of manipulating a category on your homepage?

I'm using the Genesis theme, and attempting to create a function that finds the homepage AND a specific category, and removes post content under both those conditions. Using my limited knowledge I ...
0
votes
0answers
12 views

custom forgotpassword and hook for additional function

I have other app and a wordpress, whenever if there is a lost password request in the wordpress, it will also trigger for lost password request and other function for the app API.. the password ...
0
votes
0answers
20 views

Create a Function to reference a certain file

Ok, so Imagine user N changes the design on settings to flat ui, the file changes to Framework/styles/flat/style.css from Framework/styles/default/style.css. How can I achieve this? This is possibly ...
0
votes
0answers
6 views

Why WordPress attachments LINK TO settings are not working?

Using this code below, I added some on-hover share icons for all images of the content. But, now these images are not getting any "Link To" setting from authors. I don't know what is the problem. Can ...
0
votes
0answers
17 views

Walker_Nav_Menu check if menu has parent

I created a custom function extending Walker Menu and having some few issues. I got a post from https://wordpress.org/support/topic/how-do-i-know-if-a-menu-item-has-children-or-is-a-leaf showing me ...
0
votes
0answers
31 views

How can I set and use a cookie on page load?

So I can set a cookie using the below code, and use the cookie I have created when the page gets refreshed problem is I need to set the cookie and use the cookie when the user first loads the sites. ...
0
votes
0answers
27 views

How can I include user meta information in the resulting array of a WP_User_Query?

I'm trying to accomplish some fairly complex custom functionality on a custom WordPress site. The client has an 'About Us' page that includes a list of all team members and their pictures. We're ...
0
votes
0answers
13 views

How to parse a post and change the way a gallery item is rendered?

I want to use this plugin http://final-tiles-gallery.com/index.html to display the gallery the users insert in their posts, for that I need to use an specific HTML structure so the plugin works, I've ...
0
votes
0answers
17 views

Loop a Custom Post Pagination

I am having a little trouble trying to get my custom post type pagination to loop. The idea to my pagination is to only display a next field with the title of the next post. Once you hit the last post ...
0
votes
0answers
16 views

Quicktags external functions file

I have added shortcode buttons to the WordPress tinyMCE text editor using the WordPress quicktags function. This works fine when in functions.php, however I need it to be in an external functions ...
0
votes
0answers
21 views

How to make post title determine category in wordpress

Is there any way to assign a post automatically to a category depending on the title of the post ! Suppose : Post title - This is a test post I want the post to automitically assign to category ...
0
votes
0answers
22 views

Pagination in Search result

How to do a pagination in search result? I have already an excerpt script. All I need is a script for pagination. Pls help me. Thanks function wpse_allowedtags() { return ...
0
votes
0answers
16 views

Merge PHp script into Wordpress MU for multi-tenancy

I have a PHP script with 2 database tables, one of which is named "options". I have installed a fresh Wordpress install, and I noticed the database table "options". I would like to create a ...
0
votes
0answers
38 views

Pass max posts to Javascript

I'm doing a fairly standard situation where posts are loaded with AJAX via a list. I'm having difficulty passing from WP/PHP to JS when the max posts are reached. Here's what I use to enqueue assets ...
0
votes
0answers
24 views

How to change html generated by wordpress media uploader

I have managed to change the output of wordpress media uploader using image_send_to_editor exampled below (where the output is image:($url)) However I want to do the same with other files like ...
0
votes
0answers
43 views

How to add pagination into post showing

I have created a plugin to display all posts on any page by short code. But how do I add pagination? global $wpdb; query_posts('cat='.$cat); $table_name = $wpdb->prefix . "advertisement"; ...
0
votes
0answers
61 views

Integrate WP Tiles into existing loop (index.php) and theme

I want to integrate WP Tiles directly into our Wordpress theme and into our existing loop but their documentation is pretty thin and I can't find much in the way of examples so not really sure how to ...
0
votes
0answers
19 views

Restrict Media Library to one user except for admins

I have this function to restrict the media library to one user. However I have a few admins who need access to the whole library. How can I make all of it available for admins only ? /*restirct ...
0
votes
0answers
22 views

Limit Taxonomy Parents

I've got a custom taxonomy set up as hierarchical, with a custom function to limit the number of categories the user can select to one. I also need to limit the depth that this custom taxonomy can ...
0
votes
0answers
25 views

Extract a WordPress shortcode attribute from function and apply in another one

I try to modify simple AJAX contact form so that it could take shortcode arguments. Specifically I need to send a message about the successful submission of the form, and as well error message based ...
0
votes
0answers
31 views

Plugin Boilerplate - Where should I put helper functions?

I'm using the Wordpress Plugin Boilerplate and as it's OOP, I don't see where is the place for helper functions. If I am using this for say a review plugin - and I have a function that generates the ...
0
votes
0answers
273 views

How to integrate owl carousel into theme without using a plugin?

I've been trying to integrate the owl.carousel into my theme but can't get it to work. The instructions on the page are not for WordPress so I need help with how to properly enqueue the required files ...
0
votes
0answers
19 views

Custom Fields: Linking a thumbnail to another image

I'm trying to figure a way to link a project, not to another page, but rather to an image that I'll eventually display in a lightbox but for now, it just links to the image in its' own window. That's ...
0
votes
0answers
39 views

Restrict Editing by Category

I've tried every possible user role plugin for this, but each of them no longer work with the latest edition of Wordpress (Role Scraper, Restrict Categories, Advanced Access Manager, etc). If a plugin ...
0
votes
0answers
26 views

Custom function to add a secondary logo

I'm looking to create a custom function in order to be able to change/load a new image from the "customize" panel (this because I won't be the one who manage the website, so I'm trying to made things ...
0
votes
0answers
25 views

Rotate image media item 90° anti/clockwise ajax front end function?

Is there a rotate image function that I can create a button on the front end of my website, using ajax inconjuction with the id number of the media item? I'm thinking having 2 buttons, rotate left ...
0
votes
0answers
38 views

Modify shortcode to work with custom taxonomies and slugs

I am using this code which works fine with posts but I am looking to modify it so that the user can specify in the shortcode: custom post type name taxonomy name slug of taxonomy category For some ...
0
votes
0answers
50 views

Override A Plugin Variable And Function Via Functions.php

Is it possible to override a variable in a plugin function without altering the plugin? The closest thread I found to answer this problem is this one : Pass A Value From Outside To A Plugin Variable ...
0
votes
0answers
35 views

Load a Child Theme's style.css just before the closing </head> tag

I have this in functions.php: <?php /* Import parent style - The new standard Wordpress way - No @import in CSS! */ add_action( 'wp_enqueue_scripts', 'theme_enqueue_parent_styles' ); function ...
0
votes
0answers
29 views

“View Gallery” Button to open post gallery

I want to create a "View Gallery" button which opens the gallery attached to the post. I have tried: <div id="gallery-1" class="gallery"> <a class="attachment-thumbnail" ...
0
votes
0answers
36 views

using a function in functions.php to process a form generated in functions.php

so i have a site where users can rate items, it saves their ratings to a mysql db and also tallies the average for the item, saving that as well. as it is a generic function and there are hundred of ...
0
votes
0answers
29 views

Add custom class to all URLs on entire site

I have a mobile touch script which uses the class "tapover". Now I want to insert it to all URL links on my entire site. How do I do that? Update: function strapboot_enable_mobile_touch() { ?> ...
0
votes
0answers
36 views

Created a function similar to facebook events with [ Attending / Not attending ] options

I modified and extended an event plugin on wordpress that is being hosted on GITHUB then finally came up with this idea in a separate PHP file and added options such as the ATTENDING and NOT ATTENDING ...
0
votes
0answers
18 views

CDN issue with custom image shortcode

please read the full question before downvote this question. In my theme my developer uses a shortcode for adding image in a custom post type named portfolio. Everything is good and working fine, ...
0
votes
0answers
20 views

Problem with wp_login_form()

I'm using wp_login_form(); to display the login form in the front-end. And added after that do_action('login_form'); which should display capacha verification from a plugin. The problem is that the ...
0
votes
0answers
23 views

wordpress use single ajax in place of multiple ajax requests in a smarter way

In wordpress I have database tables like this product name id product_name 1 A 2 B 3 C 4 D product_buying_price id product_name product_buying_price 1 A ...
0
votes
0answers
50 views

How To Get WordPress Categories Last Update Date?

I am trying to make a custom sitemap for my WordPress blogs categories. For that I added the below code in my functions.php file and save it. Now all things is working fine but I want to get the date ...
0
votes
0answers
58 views

How do you add content to a WordPress sub-menu dependant in its parent?

What I'm wanting to achieve is this: A submenu with content showcasing 1 product from each category after the links In the submenu. I am trying to use the WordPress nav walker to add the content ...
0
votes
0answers
42 views

Insert <!--nextpage--> after every x img tags in a post

I want to insert <!--nextpage--> after every 10 image tags in a wordpress post (if there are 30 images, I'll get 3 pages), but I can't seem to figure out how to do it. I found a php function that ...
0
votes
0answers
21 views

Getting mail recipient ID rather than current user ID

I have a custom email function in functions.php, that when an admin approves a user sends an email to them notifying them of this. However I need to add some custom data for each recipient, that I can ...
0
votes
0answers
80 views

How to add a custom HTML attribute to a parent element of wp_nav_menu?

I am using wp_nav_menu and I want to add a custom attribute that I need for uikit drop down component (data-uk-dropdown attribute) This is how the HTML should look like: <ul class="uk-navbar-nav ...
0
votes
0answers
27 views

post by Category not working after setting 4 post per page

I am trying to show 4 posts on my homepage that is working fine but whenever i click on sidebar post categories it still shows the 4 post from homepage i.e the filter doesnot works and it shows 4 post ...
0
votes
0answers
24 views

wp_get_referer function always returning false

I am trying to use wp_get_referer function along with "template_redirect" hook in wordpress like this function show_page_name() { $r = wp_get_referer(); var_dump($r); die(); } add_action ...
0
votes
0answers
146 views

Child theme - Overriding 'require_once' in functions.php

I am attempting to modify a wordpress theme with a child theme. My parent theme has the following function in its functions.php: require_once(get_template_directory() . "/includes/theme-styles.php"); ...