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

Removing all child categories from Yoast SEO breadcrumbs (or Navxt)

I am making a wordpress site and have ran into some trouble regarding the breadcrumb on single pages. At the moment it outputs Home > Parent category > Child category > Post title. This is usually ...
0
votes
0answers
45 views

Call outside functions to within wordpress widgets class

Hi i'm created widget for show soundcloud clips, and i'm created a function in function.php file to create info link within widgets to show explain images to how get clip id in bootstrap modal style. ...
0
votes
0answers
61 views

Adding custom field to permalink structure

I have a wordpress site that uses a custom post type 'external-projects'. Within that custom post type there is a custom field 'director'. What I am trying to do is rewrite the permalinks to include ...
0
votes
0answers
19 views

Return search for custom post type name

It is easy to write code that will only return posts from a certain custom post type. However, I haven't been able to find a way to return posts that search for the actual name of the custom post ...
0
votes
0answers
61 views

Loop only displaying one post

After a WordPress update the following code started only displaying one post on the page. I thought something was deprecated so I updated the parts I was sure about. But I'm still getting pretty much ...
0
votes
0answers
182 views

Using Isotope in WordPress portfolio

I'm trying to create a custom post type portfolio and use Isotope for filtering according to categories but I'm not doing something right. I've loaded scripts in my header.php, created a custom post ...
0
votes
0answers
24 views

CSS not displaying

I found function for numbe pagination but when I trying to view the CSS thru Inspect element, the CSS for that pagination is not displaying. Even If I change the CSS style, its not working. How to ...
0
votes
0answers
13 views

Custom Search Function adds Results to Navigation

I've added a custom search function on my site that allows terms of a custom taxonomy to be searched as well as the normal content. The function works just how it should, but when you get to the ...
0
votes
0answers
32 views

Add Custom fields to Quick Edit posts2posts

i am using posts2posts to connect 2 post types,and add custom field for each relation (many to many). I am looking for Quick Edit Option, here is my function <?php p2p_register_connection_type( ...
0
votes
0answers
53 views

How to block specific external link without plugin

I want to block www.anafile.com - this site, in my WordPress blog site. When any user use this link in any blog post, on clicking "Publish" button, I want to block them posting or warn them. How can ...
0
votes
0answers
49 views

Default Terms in Custom Taxonomy for Custom Post Types

I am using the below code to automatically assign a custom taxonomy (my_tax_name under my_tax taxonomy) to a custom post type (my_cpt) so that when I publish a post without assigning it any taxonomy, ...
0
votes
0answers
32 views

Define an extra field for all pages (with no plugin?)

I usually use WP Types define custom fields, post types, ... But I have a theme a little bit overloaded of plugins, so I would like to define this field for (all) the pages in functions.php if ...
0
votes
0answers
50 views

Function to draw random image from specified category destroys site logic - why?

I'm trying to create a function in my child theme's functions.php file that will draw a linked image on every page. The link has to have a class, and the image must also have a class. The image is ...
0
votes
0answers
80 views

preg_replace to switch urls

I've searched everywhere here and I just can not find the right setup; I'm trying to take a url and replace it with a non functional url... for example; CURRENT HTML URL STRUCTURE <a ...
0
votes
0answers
27 views

Extract and amend variables from 'like' plugin and put into visual meter gauge plugin

I am trying to extract the total number of likes associated with different posts from the WTI Like Post Pro wordpress plugin, then subtract the number of unlikes and feed this total into a meter gauge ...
0
votes
0answers
37 views

Adding custom post formatting options in custom post types

I've added custom post formatting options using the below code - function wpb_mce_buttons_2($buttons) { array_unshift($buttons, 'styleselect'); return $buttons; } add_filter('mce_buttons_2', ...
0
votes
0answers
24 views

Redirect to “pre-page”

I am using the Events Manager plugin to create bookings. The site currently functions like this: Page 1: Lists all events (clicking on an event takes user to booking page - Page 2) Page 2: ...
0
votes
0answers
38 views

Content Section Custom Anchor Not Working

I purchase WP theme (Techwise) and I found an issue with content menu sidebar in post page. that content not working as same (toc) Table of Content. it's not working with Arabic letters but working ...
0
votes
0answers
39 views

Custom post type archive not displaying after site move from sub-directory

I have just moved a site from a sub-directory to the root of a domain. The move went reasonably well but I came up with two issues that have stumped me. The first which I have resolved was that one ...
0
votes
0answers
26 views

Functions.php in Child Theme error issues

I have been trying to update my functions.php file in my child theme and find this code in the file downloaded from the host. add_filter('https_ssl_verify', '__return_false'); ...
0
votes
0answers
15 views

Custom Taxonomy as Link

I have this image here http://i.imgur.com/5szTQNy.png which shows the download button I will be talking about. I am trying to make it so that when I put in a custom taxonomy box in the back end the ...
0
votes
0answers
16 views

Fetch external call on specific URL

Is there a built in function which - if not how do I accomplish - can map all incoming calls on a specific URL e.g. http://www.example.com/incoming/RANDOMSTRING to a function in WordPress? SOLVED: ...
0
votes
0answers
96 views

New WP_Query calls Pre_get_posts filter twice

On my WP theme template page, I am running a new WP_Query. It seems to be calling my pre_get_posts filter twice, which then wrecks my custom parameters. The second time the pre_get_posts filter is ...
0
votes
0answers
25 views

WordPress permanently logging users out

I am using WordPress as a solution for digital signage on large displays and on personal computers in a company. In this use case the WordPress installation is a closed system which needs a login to ...
0
votes
0answers
53 views

Disable iframe in wordpress catch_that_image

I want to ask how to fix catch_that_image in wordpress ? I'm using code in wp-content/themes/name/functions.php function catch_that_image() { global $post, $posts; $first_img = ''; ob_start(); ...
0
votes
0answers
91 views

Using Xeditable with Bootstrap my post.php function says 404 Notfound but executes the db update?

I am using the Xeditable library with Bootstrap 3. I have everything setup to work... and technically it is working.. except that when I submit the value via the popover the network response is a 404 ...
0
votes
0answers
36 views

Can a single.php file be coded to allow HTML download from a button?

I have been searching on WP and on SO for a way to code a custom-single.php to allow the HTML code in that document to be downloaded from a button on the rendered site. What I have done is created ...
0
votes
0answers
10 views

Why does wp_insert_post take longer than media_handle_upload?

I've got a page on my Wordpress site where users can submit posts or documents through the front end. I use wp_insert_post for the posts, and media_handle_upload for documents. wp_insert_post takes ...
0
votes
0answers
32 views

site_url() returns with additional backslashes

I am using site_url() function and it returns the address as http:\/\/vip.local\/cc where I can see that WP automatically adds unnecessary backslashes. Is this for some escaping purpose? I tried using ...
0
votes
0answers
33 views

How can I detect if user has subscribed Memberpress product already

How can I detect if user has already bought a memberpress product. I'm searching something like this: if(have_subscription){ //code to add button }else{ // code to add something else } I have no ...
0
votes
0answers
73 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
86 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
29 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
24 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
123 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
17 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
33 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
24 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
16 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
58 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
209 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
54 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
32 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
34 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
30 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
54 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
63 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
55 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
64 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"; ...