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
144 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 ...
0
votes
0answers
27 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
0answers
36 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 ...
0
votes
0answers
48 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 ...
0
votes
0answers
38 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 ...
0
votes
0answers
61 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
51 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
0answers
44 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 ...
0
votes
0answers
301 views

Why WP_Query in functions.php is not working when get_posts works?

I have following code in my functions.php. When I try to add new post_type (e.g. post,lawyers) it fills excerpt,slug (this affects in permalink structure), other metaboxes from first post of lawyers ...
0
votes
0answers
103 views

Customize Breadcrumbs - home -> page -> childpage -> post

I use this snippet for breadcrumbs, and it works well, but not as i need it. function test_breadcrumbs() { if(!is_front_page()) { echo '<nav class="breadcrumb">'; echo '<a ...
0
votes
0answers
10 views

Archive list with only years and months belonging to a category

I need to generate a list of years and months belonging to a category. For example I have two main categories (A and B). I need a list of years and months of post published only of the category A and ...
0
votes
0answers
34 views

Adding ID to a Listing but not inside WP_Query while

<?php $args = array( 'post_type' => 'bedrijf', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC' ); ...
0
votes
0answers
34 views

Can't change local language with function

I'm trying to add a function in my theme to change the local language for certain pages. function nfo_redefine_locale($locale) { global $locale; $locale = 'de_DE'; return $locale; } ...
0
votes
0answers
39 views

Exclude a category of posts from all listings if user doesn't have a role

I have some categories that I'd like to bulk exclude from all listings (the loop on the main blog listing page, category listing pages, archives, etc.) and to show them only to users with a specific ...
0
votes
0answers
517 views

Creating custom theme options page

I am creating a theme for a client and it has a custom front page that has a slider and displays the services they offer. I am looking to add an options page where the client can easily update the ...
0
votes
0answers
21 views

Creating a custom abstract/excerpt function: retrieving text between a specific tag or id

Unfortunately, the functions for retrieving the abstract and the excerpt don't fit my needs. I want to define a part in my text that should function as abstract without falling back to ...
0
votes
0answers
58 views

Cant use php fopen() function in functions.php

I am trying to simple run fopen() in the functions.php, and have also tried it in a test.php wordpress template file. But it does not work. If I move the test.php file and csv file to a location ...
0
votes
0answers
56 views

Wordpress 2014 Theme - Featured Content with multiple tags?

My company is using the new 2014 Theme for our portfolio blog. We really like the Featured Content section on the home page. What we would like to do is have multiple pages all with different ...
0
votes
0answers
30 views

how a query can use local parameters in plugin function?

I've wanted to add a custom post type, so i've done a plugin to put on/off this post type. i have widgets inside the plugin in order to print posts with this custom type, that call more or less a ...
0
votes
0answers
45 views

Slider Issues using MetaBox Plugin

I'm just now joining a previously launched project. The home page slider is a custom meta_box type from the MetaBox plugin. Here is the code to add the fields. $meta_boxes[] = array( 'id' => ...
0
votes
0answers
89 views

Update all posts in one go

I've just used the woocommerce CSV uploader to add 1000+ products to an online store. However the products only appear in the store after they have been updated - And it has to be from the main edit ...
0
votes
0answers
40 views

how to echo script in head from plugin options page via textarea?

I know how to echo in the head but when i paste a script in the textbox in my options page it comes out like this: &lt;script&gt; ...
0
votes
0answers
30 views

Template tag for custom field sub heading in post - error

Im trying to create a template tag for a subheading for a post which is entered as a custom field. This is the function I have: function spost_subheading() { $key = get_post_meta($post->ID, ...
0
votes
0answers
63 views

Using a Multi Site Users Blog ID as a WP Prefix

I'm trying to update a plugin so that the prefix for the defined tables is taken from the ID of the posts authors site This is what I am trying to do at the moment function { global $authordata, ...
0
votes
0answers
51 views

WordPress Visual Editor Filter for Visual View

I have setup custom HTML to be created when a user inserts media using "Add Media" in WordPress using the code below: add_filter('get_image_tag', 'add_image_frames', 10, 6); function ...
0
votes
0answers
85 views

Add image caption to frescojs

I want to add the image caption to the frescojs popup. The following code is in the functions.php: add_filter( 'wp_get_attachment_link', 'sant_prettyadd', 10, 6); function sant_prettyadd ...
0
votes
0answers
45 views

Strip <p> on get_the_content_limit

I would like to remove the paragraph tags < p > it generates, i tried adding strip tags but it doesn't seem to work. function the_content_limit( $max_characters, $more_link_text = ...
0
votes
0answers
52 views

Show Custom Post Type Results

Hopefully someone can help me here. I have a custom post type and with this post type I am able to show the title in a select option. Now what I want to happen is when that title is selected it will ...
0
votes
0answers
25 views

How to Overwrite validate_plugin function

How can I overwrite the WordPress validate_plugin function. I need to disable that function alone for my plugin, and it should not affect any other plugin. I don't want the validate_plugin function ...
0
votes
0answers
366 views

Set thumbnail from URL, by grabbing image in functions.php

So I've written a whole bunch of functions, which are used to display Vine videos. I then have a shortcode which outputs the code. The last thing I have to do is set the post thumbnail. I want to be ...
0
votes
0answers
31 views

Wordpress Native Function To Show Publish Box, Select Categories Form etc On Plugin Page

The picture above showing the default forms those are available on metabox of wordpress post/page editor screen. Is there a wordpress native function to show those forms on a custom plugin page ...
0
votes
0answers
62 views

Set Featured Post Automatically - First Image included IN the post

I want to set the featured image to the first image IN the post content. I've come across a few functions that grab the first image attached to the post. Sometimes a user will add an image to a post ...
0
votes
0answers
27 views

How to add a handler for a button in plugin?

I am working on my first plugin, and I am having some confusion. I am trying to figure out how to set a handler for a button on my plugin UI. Here is how the button is displayed: <li ...
0
votes
0answers
67 views

admin-ajax.php nulls all php variables

I have a problem in a custom function. The function which adds to the WHERE clause in Store Locator Pro works correctly on its own, but I only want it to only work on a certain page, not on all my ...
0
votes
0answers
146 views

Pass jquery var to a function in functions.php

I have this js in /js/functions.js: jQuery(document).ready( function($){ //Some event will trigger the ajax call, you can push whatever data to the server, simply passing it to the "data" ...
0
votes
0answers
76 views

create submenu page - error function not found or invalid function name

I have created a plugin with a top level page. I created a sub menu underneath that. When I run the plugin on my site everything works. But when I test it on a separate site I get an error and I'm not ...
0
votes
0answers
85 views

Selectbox Custom Post Type

I use a dropdownbox to show all custom types. On the archive page of the custom post type it works fine. If I put dropdownbox to another site, it doesn´t work anymore. The selectbox is empty. Any ...
0
votes
0answers
31 views

How to control the width of the container in theme customizer wordpress?

How can i control the width of #container in theme customizer through functions.php in wordpress. I want to make a control so i can set the width from 100% to 60% or 30% of my #container How can i ...
0
votes
0answers
45 views

Wordpress javascript call functions?

wordpress runs jquery in noconflicts mode which means that you either need to write your JS code using the jQuery function call $(document).ready( function($) { $("html").niceScroll(); } ); ...
0
votes
0answers
256 views

WordPress function get_the_terms() returns 'Invalid taxonomy' error

It seems that the function get_the_terms( $id, $taxonomy ) always returns an error if used outside of WordPress (i.e. integrated in PHP using this method). I believe some library might be required and ...
0
votes
0answers
393 views

How to Update User Meta Field other than from profile?

I have created a dynamic meta field that is generated for each post type. I used the following to create the meta-field: <?php $args=array( 'post_type' => 'Course', 'status' => ...
0
votes
0answers
42 views

Including one page with WordPress functions into another

I have two php pages, one is the main page that will hold all of my content. The second page is a whole bunch of php (that I have written as well as included wordpress functions) and js functions. ...
0
votes
0answers
47 views

Adding custom classes in WP 3.8 stop working in previous versions worked ok

This code wa working great in previous versions of WP. However, after the upgrade it stops working. Why? //Add extra css classes to menu items function mytheme_nav_menu_css_class( $classes = array(), ...
0
votes
0answers
59 views

Customized Upload File Control not saving the files URL as value

I have modified a customized version of the Upload File control so that I could upload mp4 videos and use the media library. The control seems to be saving the videos as 'Array'. After uploading a ...
0
votes
0answers
51 views

making a glossary with wordpress

I know that there are glossary plugins in the wordpress repository. This plugins normally searches glossary terms in post content and adds a link to it. But i have not found one, that search and ...
0
votes
0answers
397 views

Twenty Fourteen Customization: Link Post Formats

A solution for this issue for the previous default theme, Twenty Thirteen, was found by me here. It's perfect for what I'm trying to do: set my own desired URL as the link in the title, rather than ...
0
votes
0answers
28 views

Can anyone tell me why I can't edit a plugin when it is installed without having to re-install?

I am using a shortcode plugin as a framework for the short codes I want to add that go with my theme. I decided to just include the plugin in a repo for the user to dl so I am not building theme right ...
0
votes
0answers
128 views

WordPress Bones theme, changing default Excerpt amount of words

Been back and forth with this one and cannot find anything on the Themble site about this. I am trying to shorten the length of the_Excerpt from 55 words to 20. Have checked the codex and know what I ...
0
votes
0answers
25 views

Break a Wordpress function to run in patches and re-continue

I am new to PHP and coding and I am really not a coder but I try to modify and use existing codes. I have a function which I am trying to run when needed for all users within Wordpress to do an ...
0
votes
0answers
52 views

Calling information from my theme options page

I'm setting up a theme options page, I used it on a previous theme and thought i could easily just copy it over to the new one. <?php $options = get_option( 'sample_theme_options' ); ?> ...