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)

2
votes
0answers
212 views

Display a query with multiple post types and same relationship on a single page

I am creating a client portal were my clients can maintain their projects and leave feedback in Wordpress. I have two custom post types called "Clients" and "Projects" and they each pull information ...
2
votes
0answers
50 views

How to show in search results posts with a particular tag in a particular category?

As the home page of my blog I've a static page. There I want to show the navigation of the site. Category1 Sub-Category1 tag1, tag2, tag3 Category1 Sub-Category2 tag1, tag2, tag3 ...
2
votes
0answers
103 views

Prevent “main” WPMU site_url() being returned in functions

I've noticed that in a WordPress MU install with domain mapping enabled, some functions return URIs that don't use the current WPMU site's primary domain name which possibly means they are "WPMU ...
1
vote
0answers
43 views

Multiple Loops Meta Data

I am now trying to figure out how to create the functions/ loops to pull my data from custom post types. I have two post types(keys): And I need to pull the data from both to run my functions. ...
1
vote
0answers
50 views

How to remove custom post type and add category and post name

I have a custom post type called listing and taxonomy for this listing is called listing_cat. At the moment my wordpress permalinks appear in this format ...
1
vote
0answers
57 views

Wordpress PHP Conflicting User Sessions

I'm using the following function to programmatically login users via the frontend: function auto_login() { $username = $_POST['user']; if ( !is_user_logged_in() ) { $user = ...
1
vote
0answers
49 views

Move Custom Fields on General Settings Page to New Location

I've created some custom fields on the General Settings page after studying up on this post: Add multiple custom fields to the general settings page. I'd really like to move them to their own ...
1
vote
0answers
298 views

wp-comments-post.php file returns a blank page

When i post a reply to my blog, it's return a blank page to me. It seems that happens because of this code in wp-comments-post.php if ( 'POST' != $_SERVER['REQUEST_METHOD'] ) { header('Allow: ...
1
vote
0answers
54 views

Configuring a meta query with multiple post types that have the same relationship on a single page

I am creating a client portal were my clients can maintain their projects and leave feedback. I have two custom post types called "Clients" and "Projects" and they each pull information from one ...
1
vote
0answers
88 views

Add .htm extention to a custom taxonomy

I need to add '.htm' to all my urls on a new site - client requires that, as I am converting a old static site into WP. (I use Remove Taxonomy Base Slug to hide the slug of my custom taxonomy "topic" ...
1
vote
0answers
17 views

theme_root returning a truncated URI

I'm unable to access the theme editor via the control panel, receiving 'Sorry can't edit files with .. in the name....' and after trying to trace back the cause, I've found that the theme_root is ...
1
vote
0answers
57 views

Wordpress Custom field Colors

I came across this code and would like to use it in my project. It works fine, but the problem is, I need to change those colors in the array to instead pick transparent images from url since I am ...
1
vote
0answers
133 views

Need help setting default setting value for radio button in theme customizer

I need help figuring out how the radio button saves it's value in the theme settings. In my theme I added Radio buttons in the theme customizer. So far they are working great. Although I have one ...
1
vote
0answers
146 views

Add term to custom post type on draft

I'm trying to automatically add a custom taxonomy term to custom post type when the custom post type of property is created. The action is firing but it is not adding the term. I know it is firing ...
1
vote
0answers
177 views

wp_get_archives custom function broken since upgrading to WP 3.7.1

I've upgraded a site I'm working on to the latest WP, but it appears the function I wrote for splitting wp_get_archives() into years is now broken and I can't find out why. I've turned on debugging, ...
1
vote
0answers
69 views

Custom taxonomy widget in admin area

I have a custom taxonomy set up on a custom post type and the box it uses is the same as categories, except I wanted to make it easily searchable using a filter script and then also allow the user to ...
1
vote
0answers
147 views

Query Pages and post excerpts dynamically

I have a custom home page, a blog page which includes a dynamic preview area of the latest 5 blogs, and some other miscellaneous pages. Im trying to design an "events" page where the main page has a ...
1
vote
0answers
104 views

Add button to kitchen sink toggle

I have created a simple function along with a shortcode, my goal is now to add a button in the sink toggle of wordpress so that the user doesn't have to type anything. Is this hard to achieve? how ...
1
vote
0answers
128 views

Ajax : Call undefined function plugin_function() … can't call any plugin function

I use a Ajax query to show some content, but I can't use any of my plugins functions. Javascript : $('#load_more').click(function() { var data = { action: 'load_more', id: ...
1
vote
0answers
99 views

Way to add captions to gallery images by code

I am creating posts by using wp_insert_post function. It works fine as I provide values in array required. Sometimes it is required to create a post having gallery. Without any problem, it also works ...
1
vote
0answers
76 views

next_/previous_post_link() `in_same_category` appears to fail when true

I'm using the Modernize theme's custom Portfolio type page. In the single-portfolio.php template, I call next_ and previous_post_link(), which correctly display links when in_same_category is set to ...
1
vote
0answers
161 views

get_terms not returning any custom taxonomies

I have a custom post type called project with custom taxonomy called tagportfolio I use this code to generate both: add_action('init', 'project_custom_init'); /*-- Custom Post Init Begin --*/ ...
1
vote
0answers
491 views

jQuery Plugin to use Wordpress functions in AJAX request

I'm using Chained Selects jQuery Plugin to create multiple chained selection fields. I'm using the remote version of the plugin to build the related options by means of AJAX request from a separate ...
1
vote
0answers
101 views

Multisite 404 on pages - rewrite error breaks database

After updating my reading settings on my multisites, I get 404 errors on all my pages. The only way to fix the issue is by reverting the database to previous version, that is the only way it can be ...
1
vote
0answers
208 views

Wordpress functions.php - Execute plugin specific user online

One Trick Pony posted a great script that I'm trying to adapt to my needs. Registration in my website is restricted. There is only one user, a editor. The idea is to have a Chat Plugin, and it would ...
1
vote
0answers
190 views

wp-admin won't load after setting wp-login custom url

I changed the wp-login.php url to /login/ so all links in registration and forgot password emails have /login/ rather than wp-login.php. The problem now is that when I visit /wp-admin/ or click on ...
1
vote
0answers
73 views

Need help enqueueing webfonts

I am attempting to enqueue web fonts that I am loading in via the WebINK font library. (This service is similar to Typekit). This service works by generating a unique CSS link for each unique site. I ...
1
vote
0answers
460 views

Skeleton Child Theme Add Icon Bar to Header Flex Grid

Skeleton Child Theme Version 1.6 WordPress Version 3.4.2 Child Theme installed on main Multisite: public_html, wp-content, themes. My CSS, PHP Coding skills = NOVICE What I've done: Using the ...
1
vote
0answers
46 views

Showing errors from processing function on form

I use a function from my functions.php to process a front end post form. I store the errors in the variable $output but need a way to show it on the post form after submit. How can I do that?
1
vote
0answers
86 views

Difficulty with PHP function that displays a post's format in WordPress

I am working on a WordPress theme using Bones. I would like to be able to show some text just above the title of each post if the post is either featured, password protected or private. So far I came ...
1
vote
0answers
69 views

register_taxonomy() take much queries

Sorry for my poor English, I'm russian. I have a problem by adding a lot of taxonomies. When I added about 80 taxonomies, I get the following results(without caching): before: 44 queries 0.352 ...
1
vote
0answers
95 views

Function to update post_meta based on existing post_meta

I have a custom post type for addresses on a Google Map. One meta field is for the address, but I want to convert that address to longitude/latitude. So I have a meta field for longitude & one for ...
1
vote
0answers
52 views

How to call a function from a plugin from within a different plugin's admin options panel?

I have a basic plugin admin options panel for events. I want to call a function that is from a different social media plugin (Mingle). I can call Mingle plugin functions in the theme, but not within ...
1
vote
0answers
96 views

Events: Check for other event with same start date and category

I am using The Events Calendar and (correct me if I'm wrong) there is no checking to see if an event has a time conflict with another event that's already been entered. For example, if there is ...
1
vote
0answers
404 views

bbPress plugin: forum lists not showing in correct order?

I'm running Wordpress 3.3.1 and bbPress 2.1 (plugin, not standalone) my forums are are not being listed in the front page archive or forum summary pages in the correct order; I double checked many ...
0
votes
0answers
4 views

How To Add LineBreak Or </br> In <pre> Tag?

I am sharing codes in my WordPress blog but I don't want to use any plugin or third part to host and format my codes. I add codes and use <pre></pre> tags around it but the problem is that ...
0
votes
0answers
12 views

Create a random list of html items within a shortcode in the functions file.

I'm trying to create a function that randomly pulls lines of code for a list of HTML items. Basically, I'm going to have a list of 50 or 100 images with hyperlinks associated with them. I'd like a ...
0
votes
0answers
16 views

Function to add image link from php to fancybox js

I've got a single-cpt.php page on my website that has a photos' section this needs to display multiple images of the product/location. At the moment when the photo thumbnail loads a lightbox comes up ...
0
votes
0answers
7 views

Accessing current post data through a function

I'm using ninjaforms on my wordpress site and i have a form that is displayed on my post template. The idea behind the form is give the user a PDF file once they have completed the form. I need to ...
0
votes
0answers
28 views

List Most Read Posts from last 7 days (with custom post type and other meta queries)

I am using following code in my functions.php to count the views of the post. // function to display number of posts. function getPostViews($postID){ $count_key = 'post_views_count'; $count = ...
0
votes
0answers
14 views

Adding stick post button to edit post page

Right now, posts can only be sticky through the quick edit panel. Can I add a sticky checkbox to the post edit page?
0
votes
0answers
72 views

Adding jQuery datepicker to Custom Post Type Metabox

I've created a custom post type metabox which displays and functions fine. The problem is with the datepicker it just doesn't seem to work, when clicking the metabox youre able to type in it rather ...
0
votes
0answers
36 views

Incorrect output with get_attached_file()

I am having troubles with file encodings while retrieving file names with get_attached_file(). The line: get_attached_file( $attachment_id ); Is getting me results like: ...
0
votes
0answers
10 views

Call plugin function from button and then forward

I'm new to WordPress plugin development (new to PHP in general) and I'm looking for my plugin to run some if checks and then forward to a new page after a submit/button was clicked. I am currently ...
0
votes
0answers
50 views

Create post using Ajax

I want to create post using Ajax . I had followed the process from Insert Post using Ajax But I couldn't make it work. Here is what I did. Please see what I did wrong as I am just a learner. EDIT ...
0
votes
0answers
11 views

check value on external url - WP

i need a form feeld on WP page to enter a code. this code must be checkt on a external url. So as example the code is: 4445000000395 it must be checked on: ...
0
votes
0answers
30 views

Sanitize html, where to sanitize

I have a function that returns an style=".." html attribute. I am not sure how to sanitize. Here is the code: functions.php function zz_style($properties, $values) { $styles_array = array(); ...
0
votes
0answers
15 views

My function ajax only be called only once

Well...I've one problem when I using ajax in wordpress. I'm using ajax when in the site anybody will send me a email (like a contact). I used my function in my page "Contact" and it's works. But I ...
0
votes
0answers
26 views

function get_page_permastruct() on a non-object

global $user_ID; $page['post_type'] = 'page'; $page['post_content'] = "Hello world"; $page['post_parent'] ...
0
votes
0answers
28 views

How to make a plugin theme-wide?

I have written a working plugin and meets the criteria. Although I've encountered an issue, I've noticed that it's only usable on the theme's functions.php that I write the function and specify the ...