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
0answers
1k 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
62 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
187 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
78 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
258 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
229 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
87 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
280 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
123 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
173 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
147 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
98 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
206 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
738 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
127 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
293 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
237 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
87 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
557 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
54 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
96 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
77 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
117 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
71 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
121 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
535 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
18 views

Converting 'hours ago' into a date and time format

Is there a function in WordPress I can use, or can someone help me complete this function that turns 'hours ago' into a certain date and time format? I want to use a BuddyPress 'since' parameter to ...
0
votes
0answers
13 views

Hide pages + widget edit

I have 2 questions on this site i have this item i was wondering how can I make this item not show in the widget area or any other part of the site but still be accessible if some1 has the link to it ...
0
votes
0answers
25 views

Using external function() from functions.php

Does anyone know how to use a function() which is written in a plugin file... I want to call this function() from theme's functions.php.
0
votes
0answers
14 views

How to call a function declared in post.php

I have created a function which checks the post meta data of the post and then chooses a particular category for the post. The function is working fine. I have declared it inside post.php. I want this ...
0
votes
0answers
30 views

Wordpress theme not show php correctly

On my server i got an updated version of WP, with a working theme. I just made a new one. The problem is that when i activate it, (or just preview it, via customize) it doesen't render php script. ...
0
votes
0answers
14 views

Using the function of wordpress in the director on another folder

In the public_html I have installed my wordpress there, the folder wp-content wp-admin were there I'm thinking if I have another folder called 'test-folder' and I have a file there which is test.php ...
0
votes
0answers
14 views

When a user logs in, how can they view the website instead of the admin menu?

I added Login/Logout buttons through a function: // Add Login/Logout to Menu function add_loginout_link( $items, $args ) { if (is_user_logged_in() && $args->theme_location == '...
0
votes
0answers
31 views

Display most popular in the past two days

Hi I'm using this code below to display the most popular post on my wordpress site. It works great! I was wondering if there was anyway to show the most popular post of the current day? This in my ...
0
votes
0answers
39 views

jquery Load All Wordpress Post and Pages Into Div Using AJAX

Ok So I am working on my first Wordpress them based off html5 template that I created myself. Right Now On the site I have a continous music player. It allows the users to listen to music while ...
0
votes
0answers
27 views

Passing Persian characters to wp_localize_script string is utf8 encoded

I am trying to pass some data to my front end page using wp_localize_script in Wordpress but the return value is somehow UTF8 encoded! How can I prevent this action or decode the content when I need ...
0
votes
0answers
17 views

Init action and refresh page after form action

My problem is that I can't refresh the page after a form action into a loop. In my case I have a listing post page where I can delete, archive, deliver posts through a modal form, row by row. After ...
0
votes
0answers
27 views

How can I add rewrite rule for custom page?

I'm showing child categories data in custom page using wordpress. Problem is that i'm fetching those child categories from parent category slug. www.example.com/digital-post-page/?cp=category-slug ...
0
votes
0answers
33 views

wp_mail Not Working Correctly

I am trying to use wp_mail to send an email with an attachment, but there are a few issues: 1) The attachment does not appear 2) I have to use the direct URL to send the email (not working on button) ...
0
votes
0answers
11 views

How to get new posts via Ajax when using Waypoint.js

So I have an ajax call in one of my pages when you hit a certain waypoint within the dom. I then call a Wordpress function that I have created. The function is working in that it gets the first posts, ...
0
votes
0answers
11 views

Gallery Meta box not showing on single post

I want t replicate a Tour module into restaurant, not much gud in development so have created a Custom Post Type "Restaurant". It has same features as "tour" have but i get stuck when a Gallery meta ...
0
votes
0answers
35 views

Block user redirection to wp-login.php on leaving password blank in frontend login

When a user leaves the Username / Password / Both Blank and clicks login in frontend buddypress login, he is being redirected to wordpress admin login url stating wrong username/password/empty ...
0
votes
0answers
23 views

Auto expire page that contains specific text

Sorry, I'm relatively new to Wordpress. Is there a function or script that can automatically expire a page that contains specific text? I am using an RSS feed to display some content on a page (not ...
0
votes
0answers
16 views

How to a override parent theme page that has been included with require_once?

I need to override a parent theme file which is added in function.php like this: if (class_exists('Woocommerce')) { require_once( get_template_directory() . '/woocommerce/config.php'); } A template ...
0
votes
0answers
15 views

auto metakey value on post tile

I have this metakey "word_srch" the metakey has no value, i have to input the value in the custom field in the backed, instead, how can i create a function code that will automatically input the value ...
0
votes
0answers
15 views

Transfer custom post nav (prev/next) from one to another theme

I bought two themes and just want to assume a special next/prev post navigation from the first theme in the second theme. I've searched the theme files and found the function, which declares this ...
0
votes
0answers
19 views

Plugin - overwritting entire non-pluggable function

In order to achieve what I want to do with my plugin I need to modify several functions inside comment.php and comment-template.php ( for instance some code lines like if ( is_user_logged_in() ) : ) ...
0
votes
0answers
44 views

Issues with title-tag and document_title_parts

Wordpress version 4.5.1 I'm trying to dynamically update page titles on a particular template. After lots of digging and learning about the wp_title() changes, I'm attempting to use ...
0
votes
0answers
19 views

get_pages() shows either ALL pages or just main-menu

I'm losing the battle with get_pages(). What I'd like is a list of child pages to display on each main-menu parent page. I'm trying get_pages() rather than wp_list_pages() as I'd like to be able to ...