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
38 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 ...
0
votes
1answer
33 views

Deactivate a plugin on wp version

I've creating a theme options page at the moment and was playing around with this function deactivate_plugins() I'm running wordpress 3.8.3 so running this code in my plugin should uninstall it. ...
1
vote
1answer
36 views

Wordpress function/template tag to get first n words of the content

OK, this might be a duplicate, I was just unable to put my idea in proper search terms, sorry for that! Is there a built-in function or template tag to get the first n words of the content? I mean ...
0
votes
1answer
25 views

Create Logout Link Wordpress Admin Menu

I'm looking at creating a Logout link in the Wordpress admin menu that when clicked the user is logged out immediately. I don't want the Logout link to be a submenu of an existing menu, I just want ...
0
votes
1answer
29 views

Fatal error: Cannot redeclare when switching themes

I've built a theme from scratch which is named "core". Core has a child theme called "core_child". My child theme works perfectly and only contains the following: /images screenshot.png style.css ...
1
vote
1answer
40 views

Making Quote Plugin more efficient

I've been working on this plugin the past couple of nights and have been jotting down idea's of how to improve it. My knowledge of php isn't the strongest and I'm learning as I go along most of the ...
0
votes
1answer
27 views

Adding body class when post contains a specific shortcode

Simple shortcode function : function my_shortcode_function($atts,$content=null){ // Do something return $content; } add_shortcode('my_shortcode','my_shortcode_function'); I wonder how to add ...
0
votes
0answers
13 views

Gravity Forms After Submission - GFFormsModel::update_lead_field_value?

I am working with Gravity Forms. This code works with a couple issues : add_action('gform_after_submission_14', 'post_contract_update', 10, 2); function post_contract_update($entry, $form) { ...
0
votes
0answers
11 views

function triggered by “manage_users_custom_column” filter not working

I am trying to add a custom column un users.php but it stays empty. I have successfully added a column to the users admin page with this code in my theme's functions.php file: function ...
0
votes
1answer
33 views

Saving an array to get_options

I'm trying to save an array to get_options in wordpress, I'm aware that I don't have to serialize the array due to get_options doing that. At the moment I don't get any success of failed message upon ...
0
votes
1answer
32 views

How to extract the variables out from “add_shortcode” function?

In Wordpress, lets say i have a custom Shortcode function, like: function foobar_func( $atts ){ //whatever required processings here... $foo = "the value is foo!"; $bar = "the value is ...
0
votes
1answer
16 views

Permission error on plugin save

When I pass a quote to the input field and save it I get this error message in wordpress - I'm using the latest installation version. Error "You do not have sufficient permissions to access this ...
0
votes
0answers
19 views

Let users upload image(s) to the post from front end

I want to enable logged in users (Wordpress) to submit posts from front end (among with other data). My form is working great, I add custom post meta data which I later display on custom post page. ...
0
votes
1answer
30 views

relation OR instead of AND - Filtered term ID's in loop

Question not related anymore.. First I tought about the relation OR/ AND for results, but I believe I should work with 'operator' => 'NOT IN'. I would like to query the results that meet multiple ...
1
vote
0answers
30 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" ...
0
votes
0answers
36 views

Create thumbnail on PDF upload with Gravity Forms

I'm working with some great code that was provided recently to create an image thumbnail from a PDF upload, and I'm now trying to implement this in the functions file so that it can be applied to any ...
1
vote
1answer
18 views

How to get correct URLs in network wide menu (Multisite)?

I'm using this function to switch to my main website's navigation and display it on all sub sites in my multisite network. Ideally the links should have the following format: ...
0
votes
0answers
22 views

A function to check if the visitor is in a specific URL [closed]

I'd like to have a function to know if an visitor (user or guest) is in an specific page.. I have a page with chat. when i enter to the index page i want to know if someone is visiting the chat ...
1
vote
1answer
35 views

Get current post id in functions.php

I have a wp_localize_script() function in my functions.php where I need to push the current post ID of the current post to a jQuery file. So I was wondering how you can get the current post ID of a ...
-2
votes
0answers
16 views

What are Differnce Between [closed]

I know Below Question Might be asked many time or having many answer in Google. But i dare to ask below Question as it WordPress most helpful website. 1 } Filter and Action 2 } apply_filters , ...
0
votes
0answers
15 views

Saving plugin data returns “You do not have sufficient permissions to access this page.”

I'm developing a quote plugin which will save a quote to the WPDB using a form to input the quote. I've created half this code and got the other piece from another programmer on here. I'm looking to ...
0
votes
3answers
27 views

Formatting Multiple add_theme_support Arguments

In my functions.php I have the following: add_theme_support( 'post-thumbnails', 'html5', array( 'comment-list', 'comment-form', 'search-form' ) ); …which in WP 3.8.1 disables e.g. featured image ...
0
votes
2answers
64 views

jQuery does not work

I am working on a project where I need jQuery for. I added this to my functions, and the scripts are loaded in my header if I watch my page source, but jQuery doesn't work. What am I doing wrong? ...
0
votes
3answers
16 views

Print Post Parent Title

I'm trying to print the posts' parent title on the page as well as the post title for that page. This is how my content-page.php template currently renders the page title. the_title( '<header ...
0
votes
0answers
20 views

Dynamic banner for use on external sites

Pro question: we would like to display our most current wordpress articles on external sites (something like advertisments or banners). I think this could be easily done with iFrames, but I doubt ...
1
vote
1answer
58 views

Saving Plugin settings to the database

I'm not a complete novice with php or wordpress but am wanting to approach this problem the most efficient way so believe asking here will help. I've got a plugin that randomly generates a quote - ...
1
vote
1answer
36 views

How to customly read JWPlayer's “Playlist” items by using its “playlistid”?

In Wordpress (3.8.1) and JW Plugin (v2.1.2) with JW Player (v5), I need to read off the items contained in the Playlists of the JWPlayer Plugin. Normally The JWPlayer Plugin works like this, via ...
0
votes
0answers
31 views

wp_list_bookmarks(); not displaying anything

Bizzarely, I can't get the wp_list_bookmarks(); function (inside a page template) to render anything. Hope somebody can point out something obvious! Cheers. Here's my code: <?php /* Template ...
1
vote
1answer
36 views

Execute a shortcode when clicking on a image

I asked this in stackovorflow under javascript and was informed not possible so I trying here I have a shortcode for a opt-in form and I want it to pop up when a image is clicked I tried the ...
2
votes
1answer
33 views

Custom registration URL lost when user makes signup mistake

I've followed instructions found on this site and elsewhere on the internet intended to let me give certain people a registration link that will let them sign up with a specific user role. The user ...
1
vote
2answers
42 views

When using wp_enqueue_script(); in a theme why don't we use add_action?

When using wp_enqueue_script in a plugin, I have always been told to use an add_action : function add_my_css_and_my_js_files(){ wp_enqueue_script('jquery-validate-min', ...
0
votes
2answers
48 views

how to display a page before the home page

I want to build a wordpress theme in which there is a landing page made by an image and a logo; when the logo is clicked the theme have to go to another page in which there is the navigation bar and ...
-4
votes
1answer
36 views

Echo get_option displays as text

I am trying to use some code that is stored as a settings option in WordPress. When I try to use the following code below however, it show up as plain text instead of executing. The option I have ...
4
votes
3answers
89 views

Plugin update error message

I'm working on a client website where the framework requires a specific plugin version to work properly. With the follow lines of code in my functions.php file, it stops the plugin from updating ...
0
votes
0answers
17 views

action that only applies when certain item is in cart

I am using a function to automatically apply a coupon for certain products.The coupon only applies to a single category and is for a one-time event where those customers are only presented this ...
5
votes
4answers
203 views

Add image size if page template

I'm building a members website with WordPress Multisite. Is it possible to restrict how many images are being generated depending on the selected template? I have tried the following lines of code ...
2
votes
1answer
27 views

Change comment_reply_link URL

I have a reverse proxy pointing my WordPress Blog (CNAMED at blog.example.com) to www.example.com/blog/ Most everything is working well except for comment reply links. Those are skipping the /blog/ ...
0
votes
0answers
27 views

Load wordpress enviroment for external content?

We have a couple of forms and landing pages that cannot be stored in our wordpress installation as posts/pages. For this reason they remain apart from our Wordpress installation in a folder though ...
-1
votes
0answers
23 views

How to make a shortcode for returning HTML Value using condition inside a function.php?

I'm practically new in Wordpress Development and currently trying to make a shortcode for displaying condition user_logged_in by returning HTML format. Its not working very well and deteriorating the ...
0
votes
0answers
30 views

Problem with checkbox using custom field archive

How can i get archive base a custom field. I try this but my hosting say there is a problem with my code, the code make manny select in the database.. I have 1 post type, and 2 custom field ...
0
votes
0answers
29 views

How to: Get the first image from the next and previous post in single.php? (5 posts)

I know I can call a function below but it works in loop at index.php only. function catch_that_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = ...
0
votes
2answers
17 views

Change default upload images size for contributors

When a contributor uploads an image to a post, the default image size option is set to Medium. How can I change it to Large or Full?
0
votes
0answers
14 views

Defer all js except certain ones in functions.php file

I read How to add defer="defer" tag in plugin javascripts? and the code @toscho posted works good to defer certain js files or deferring ALL js files by commenting out the contact-form-7 ...
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 ...
0
votes
2answers
44 views

How to display data from custom fields in my custom shortcode?

This is the shortcode I have come up with, according to a tutorial on Dig WP (http://digwp.com/2010/01/custom-query-shortcode/) in order to display list of songs on specific albums. [loop ...
1
vote
1answer
20 views

$wpdb->wp_users returning empty value for

I have a code Example: function custom_func(){ global $wpdb; $wpdb->flush(); //tried with and without this line $getTest = 'SELECT * FROM $wpdb->wp_users LIMIT 1'; ...
0
votes
0answers
42 views

Highlight only current on single pages

Goodmorning, I tried to highlight the childs also in the navigation. I came up with this code. It works, but it will highlight all menu items in a row. What do I wrong or forget to add: function ...
-2
votes
1answer
15 views

Save output of the_content_rss into variable

How can I save the output of the function the_content_rss into a string variable?
0
votes
2answers
22 views

How do I change a parent theme's function through the child theme?

This is a function loaded by the parent theme. Through the child theme, I want to change this function to say is_single instead of is_singular. What would be the correct way to achieve this? ...
1
vote
3answers
57 views

Displaying Custom Post Types In “At A Glance” Meta Box

I found the following snippet will displays the number of Custom Post Types published in Dashboard's At A Glance widget, like this: Is there a way to turn that "81 Wrestlers" text to a link to the ...