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
1answer
143 views

Dynamically adding Captions to images

I have a site where the author has included Amazon Affiliate links. They've done this by adding the URL to product images. I'm wondering if there's a way to add a function that will automatically add ...
0
votes
1answer
198 views

call wp_insert_user in custom class doesnt work

im creating a custom class to manage users in wordpress and chamilo but this is not the point. Class looks like this: class Platform { private $security_key = '..'; private $secret_key; ...
0
votes
1answer
58 views

Rich Custom Field for Custom Post type not saving

I am new to creating meta boxes and I am trying to create a custom field meta box that is connected to a custom post type which is created by WooTheme Sensei (Post type = lesson). I am trying to use ...
0
votes
0answers
48 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
1answer
148 views

Dynamically Generating User Meta Field

I have an online education website using WordPress. I have a custom post type called "course" which is created automatically through the e-learning plugin I am using "WooThemes Sensei". I am still in ...
0
votes
0answers
72 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
1answer
33 views

Retrieve array of attachment IDs attached to a given Post ID

I wonder if there's a function to retreive an array containing the attachment IDs of images that are atatched to a given post. Some function like get_post_arry($pid); The array should be ordered like ...
0
votes
0answers
52 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
2answers
56 views

Get Value of Custom Field

I use a dropdownbox to show all custom types ('abschreibungstabelle'). It works fine. But now, I want to show the value of the custom field 'nutzungsdauer' in my input-field. Any ideas? <input ...
0
votes
1answer
62 views

Dynamic Title for custom post types

I use a custom post called "abschreibungstabelle". For all posts, I want to set the meta title dynamically: "This is a test: " & the post title Is there any easy way to do this: Actually I use ...
0
votes
1answer
2k views

Contact Form 7: custom validation [closed]

I'm currently using the Contact Form 7 plugin, which is great and works perfectly, but what I'm now trying to achieve with it is some custom validation rules. I found this extension: ...
0
votes
0answers
410 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
1answer
171 views

Function to list posts from current post's category fails in WP 3.8

I have this function in my child theme's functions.php, whose simple aim is to list a number of posts, only from the category of the current post, but not the current post itself. It was working fine ...
0
votes
1answer
71 views

Optimizing multiple WP_querys into one call?

I have finished building my website and noticed due to the structure it takes 3 seconds to load the data due to each WP_query bouncing between different post types. I was wondering if I put these into ...
0
votes
2answers
29 views

add_theme_support not outputting thumbnails

so, i wanted to thumbnails in my query and i came across add_theme_support, it says you have to have that to enable actions such as thumbnail, so i put the following in my functions function ...
0
votes
0answers
29 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
149 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
2answers
82 views

str_replace not responding in functions.php [closed]

I'm tring to use str_replace within a wordpress function but its not working. My code: function fields($content) { if(is_feed()) { $post_id = get_the_ID(); $url = ...
0
votes
0answers
56 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' ); ?> ...
0
votes
1answer
134 views

Have custom post type Visibility be private by default, and have radio button also set to “Private”

I have been following the advice of this answer, but ran into a glitch... The post Visibility says "Private" on my custom post, but if you click the "Edit" link to reveal the radio buttons, the ...
0
votes
0answers
29 views

Add custom css to menu while using custom nav_menu_tag

I created a custom menu to replace my li with td markers. However, I need to be able to add some custom tags through the wordpress menu. How do I do so? Is there something I can add to my ...
0
votes
3answers
962 views

How can I loop into two different DIVS without repeating the DIVs

I am having a little trouble trying to figure out how I can accomplish this: I have a container with two colums in it, a right and a left column. Each column will have 3 posts with a short excerpt ...
0
votes
2answers
174 views

How does child theme functions.php work with parent theme functions.php? Is it like CSS? [duplicate]

I am looking for help on understanding how child themes and parent themes functions.php work. I know with CSS, the cascade overrides CSS declared earlier in the style sheet. It is my understanding ...
0
votes
2answers
26 views

Empty Date Returned on my function

I am using this function to display the date and title of my latest posts on my dashboard. However for some of the posts the date is not being displayed at all - I have a feeling this might be the ...
0
votes
0answers
24 views

WP supersize not displaying when different languages flags are selected

I've got a very strange problem with this website. The background slides appear when your English flag but when its switched to The Spanish flag or Other flag the backgrounds don't appear. Link to ...
0
votes
1answer
61 views

Show latest custom post types on dashboard

I am using this code which shows latest posts on my dashboard but it doesn't work for custom post types. Would appreciate how to modify code. function wps_recent_posts_dw() { ?> <ol> ...
0
votes
2answers
422 views

How to limit the number of results for all query_posts on mysite

I have a huge number of posts and the pagination with no limits eats my server CPU and ram so I need a function to limit the number of posts for all query_posts on my site and I need this function to ...
0
votes
0answers
43 views

How to escape shortcode content? Do I even need to escape or validate?

I've written a small shortcode that wraps it's content into a HTML element, like so: [my_shortcode]The sun is shining today.[/my_shortcode] In my shortcode function, I basically return the string ...
0
votes
1answer
183 views

Woocommerce Attributes pulling in wrong data

My Problem is very strange - I don't fully understand all the aspects of woocommerce just yet and am still fiddling with things to understand it. I'm trying to pull in the size attributes for each ...
0
votes
1answer
29 views

How to get category pages to look like a certain archive page?

I'm not sure if this question has been answered, I'm not sure of how i should have even worded this question but... I have a custom post type called videos and the style of the archive is different ...
0
votes
0answers
74 views

restrict access to specific urls on a specific period of time

I have a countdown timer plugin which is set do redirect the user to a specific permalink after the time is elapsed. I've added a countdown timer here : mywebsite.com/mypost which is set to 3 days ...
0
votes
1answer
95 views

Updating User Meta from Custom Post Field Upon Publish Not Working

I'm trying to get the user_meta to be updated based on the custom post field type. However the information won't transfer if the new post is published by a user through a frontend form. Currently it ...
0
votes
1answer
48 views

How to get tags and categories?

I used the following code to get tags from the post and then simply echo them: $posttags = get_the_tags($post->ID); if ($posttags) { foreach($posttags as $tag) { echo $tag->name . ', ';} ...
0
votes
1answer
86 views

wp_list_pages change <ul> of children and anchor of parent

I am getting the list of Pages and Subpages by wp_list_pages(). I want to change the parent <a> and <ul> child. I found a solution here in this WPSE thread. But It only changes the ...
0
votes
0answers
28 views

Using conditionals, maybe from a DB, to register & enqueue files, for varying pages, in functions.php

I wanted to include some javascript and css files on only some of my WordPress pages. To do this, I registered and enqueued the files in my child theme's functions.php file, and used conditionals to ...
0
votes
0answers
108 views

Use $_POST['value'] inside functions.php

Is it possible to use a value stored in POST on a page inside the functions.php file? First on the . after the "20" I want to add the category__in value to the query_vars. And thats where I want to ...
0
votes
1answer
66 views

add slug beside name in Admin Category Checklists

im creating a lot of Categories with the same Name and different slugs, but im having problems identifying which is which in the admin panel, so i came up with the idea of inserting the slug besides ...
0
votes
0answers
49 views

Change conditional tag in wordpress without editing the core files

In wp-admin/includes/class-wp-posts-list-table.php lines 59-69: if ( !current_user_can( $post_type_object->cap->edit_others_posts ) ) { $exclude_states = get_post_stati( ...
0
votes
1answer
45 views

Breadcrumb how i can display page title with parent > child title with permalink ? any Idea

function the_breadcrumb() { global $post; if (!is_home()) { echo ""; if(is_single()): echo 'Main'; else: echo "Home"; endif; echo " / "; if ( ...
0
votes
1answer
69 views

Is there an error in get_the_tag_list()?

I'm using the theme TwentyThriteen1.0 for my WordPress blog. I recognized that the tags in the meta-part of an article are not separated by a comma. I had a look at the function ...
0
votes
0answers
281 views

Email attachment not working using wp_mail function

I am trying to send email with attachment but, I am not getting any attachment but I am getting the email bellow is the function ,I have used in function.php and I am trying to attach a zip file fro ...
0
votes
0answers
46 views

Getting undefined index id error in theme

I am getting Notice: Undefined index: id on the line $id = $option['id'];in my wordpress theme adminfunctions.php file Can you please help. function of_option_setup(){ //Update EMPTY options ...
0
votes
0answers
124 views

Pass PHP variable between functions in functions.php

I have a WordPress Admin page where you can add a "listing". Within this Admin Page I have added many fields which transfer variables over to the listing page which is created/updated. Within this ...
0
votes
0answers
142 views

jQuery conflict on EDIT POST page - Getting blank White Screen

I have made a button to show up on ADD/EDIT POST page with onClick function to import values and insert to custom fields. My button/script looks like: <script type="text/javascript"> ...
0
votes
1answer
59 views

Admin Panel errors because of functions.php

I'm creating a new theme in WP and I started noticing some errors in the Admin Panel. For example, when I want to update a page adding new content (or a blog post), it redirects to wp-admin/post.php ...
0
votes
0answers
109 views

Insert image in custom row using woo-commerce plugin function

I am using the woo commerce plugin in bellow function ,I am trying insert one image which is stored in one session variable into the custom row woocommerce_order_items table File Name-> ...
0
votes
1answer
25 views

Pagenav Not appearing on custom Template

I've just finished building a custom page template using the following code. The issue is the pagenav doesn't work - But works on every other page with multiple posts. I want this one to appear if ...
0
votes
1answer
163 views

How to add nav menu items to a specific position within a menu

I'm adding login/logout links to a nav menu using the following code: function rp_add_login_logout_links( $items, $args ) { $link = wp_loginout( get_permalink( get_option( ...
0
votes
1answer
40 views

How do add_action and WP_Query

I am new to WP, semi-new to PHP and new to OOP. 1) How can the WP function add_action receive another function as its argument? I know this by itself is not possible. I deliberately broke some code ...