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
31 views

Create custom permalinks / rewrite

How can create a custom permalink in my functions file that would include a template page when you go to a custom url: http://example.com/members/settings I have a template page at ...
0
votes
1answer
34 views

wordpress get_post_meta give only first value

I made one custome post in that there is one custom field call _as_roomname. I create total 5 custom post and I want to retrive all it's name but I get only first value. function postlogo(){ global ...
0
votes
2answers
70 views

gform_after_submission content appears immediately after <body>, not in post body

I have the following function that successfully uses form fields (IDs 13 and 18) from a Gravity Form (ID 18) as parameters within wp_query. This displays a list of posts with specific taxonomy terms ...
1
vote
1answer
66 views

Gravity Forms field entries into wp_query loop

I have a simple function that filters the page content when form (ID 18) is submitted. It simply displays the entry of field (ID 13)... add_action("gform_after_submission_18", "set_post_content", 10, ...
4
votes
1answer
87 views

Remove a menu item created by a plugin

I'm trying to remove a menu item and tried several approaches, but have not had any luck. It was created from a FAQ plugin. If I use this line: remove_menu_page( 'edit.php?post_type=question' ); ...
0
votes
2answers
64 views

Is it possible to disable a function of a parent theme?

I was wondering whether it is possible to completely disable a function that is called in a parent theme's functions.php and if so, how? (Of course without deleting the function. Rather by adding ...
1
vote
1answer
27 views

Remove class that has been added by parent theme

My parent theme generates the following class in body: style-cupcake. I don't want that. The best way to get rid of this is by adding my own functions in a functions.php file in my child theme, right? ...
0
votes
0answers
32 views

Registration Fail Redirect Problem

We use two registration links allowing users to register for different roles: /wp-login.php?action=register&utype=subscriber /wp-login.php?action=register&utype=contributer The subscriber ...
0
votes
1answer
39 views

Why does modifying my functions.php file always result in a server error

Basically, every time I modify my functions.php file and reload it to the server my site "breaks" and nothing loads. As soon as I delete it, it starts working again. Now before anyone freaks out, I ...
1
vote
1answer
48 views

Setting Up Scheduled Tasks (For Scripts to Run)

I am going to make a script that requires a scheduled run time. What is the best way to do this in Wordpress? Or maybe this can be done through some PHP method? I'm having a hard time finding even a ...
0
votes
1answer
119 views

Post visibility option to theme front-end for author to select?

Is it possible to present author with an option to select visibility of a post (public, private, password) on theme front-end post adding without messing with Wordpress core? Any suggestions are ...
0
votes
2answers
50 views

Wp admin - Set default value to 999 in comments

When you are at the comments menu in wp-admin you only see 20 comments at the time, so if you want to delete alla comments you can ONLY mark the 20 comments you see on current page. It dosent mark ...
3
votes
1answer
64 views

Different wp_mail_from and wp_mail_from_name for specific situations

I'm wondering how to create differents wp_mail_from and wp_mail_from_name for specific actions that use the built-in mail system in Wordpress. For example, when a new comment comes, notify the user ...
0
votes
2answers
61 views

Adding code to the function file

I would like to move my large php functions out of the index or template files and into the function.php file. Would it be something like this? function grab_code(???) { ??? .= '<div>some ...
1
vote
1answer
23 views

comments_number display outside specified span

I want to display the number of comments a particular post has, so i thought i'd use comments_number, however when i use this the comment number gets printed outside of the span it's supposed to be ...
0
votes
1answer
42 views

Conditional Content Display

I"m trying to replace the string "Something Nice will show up here" in the block of codes below with WordPress loop but it doesn't seem to be working. I'd like when Link1 is clicked on, let the post ...
1
vote
1answer
23 views

problem with has_post_thumpnail in foreach loop

I have a code that display the post if has_post_thumpnail the problem is it shows all the posts wheather it has thumpnail or not <?php global $post; $args = array( 'numberposts' => 5 ); ...
0
votes
0answers
19 views

PHP Parse error - wordpress [closed]

can anyone please assist me? I have this error on my website (wordpress) when trying to load it. I was in functions php doing some coding. Then I deleted the coding I placed in there, but the error ...
0
votes
1answer
35 views

Archive.php, and post_is_in_descendant_category

I've got a small issue with my archive.php. I was trying to set up an If statement that displays a certain category and sub categories with a different layout & sidebar based on my theme options. ...
4
votes
1answer
76 views

function_exists call in function.php

In the function.php file of the twentyeleven the setup function checks to see whether it exists before running it: if (!function_exists('twentyelevent_setup')): function twentyelevent_setup() { ... ...
0
votes
1answer
123 views

WooCommerce Tabs

In my theme, I have the WooCommerce plugin installed and would like to rename the "Catalog" tab, located under the WooCommerce > Settings submenu page. Am I able to do this from my functions.php ...
8
votes
3answers
175 views

How to change the case of all post titles to “Title Case”

I am helping my father with his WordPress website. It has over 1,700 posts with TITLES IN UPPERCASE. We'd like to change these to "Title Case" in the database (possibly using this PHP script). The ...
1
vote
2answers
52 views

Dynamically add id to heading tags

How do I add an id attribute dynamically to every heading tag on a wordpress website using php? I wanted to make it so that for every heading tag (h1, h2, h3, h4, h5, h6) I have a unique id attached ...
0
votes
1answer
43 views

Perform function on publish AND save (not just save)

I am using this function to auto-set a post title based on a couple of custom fields: function set_event_title( $data , $postarr ) { if($data['post_type'] == 'event') { $getdate = ...
0
votes
1answer
42 views

Saving multiple Metabox contents

I'm putting together a fairly simple Custom Page for a friend on their WordPress site, but I'm having some real difficulties getting the contents of the Metaboxes to save correctly. WordPress doesn't ...
0
votes
1answer
36 views

Defining multiple categories for showing latest posts

I have a function that lets me display the latest posts on my website, however i want to function to show posts of multiple categories at not just one specific category. Check the code below and what ...
0
votes
1answer
77 views

add sidebar area to header of child theme

How can I add some extra sidebar locations for widgets in a child theme. The difficulty I'm having is because the parent theme uses some pretty gnarly setup to define the current sidebars. I would ...
1
vote
2answers
33 views

2 Loops, Only Displaying 1 Loop in Both Loops

I have 2 loops, movie trailers and gaming trailers but gaming trailers is displaying under both Movie Trailers and Gaming Trailer. Each loop displays the post tagged with either Movie Trailer or ...
2
votes
0answers
27 views

Modifying Footnote Plugin for Descriptive Title Attributes

I've been struggling for a couple hours now to get this working... Hopefully someone here can help me. I just started using the wp-footnotes plugin, and I'm trying to set the title attribute on ...
0
votes
0answers
26 views

previous_post_link() : Within all categories except one

According to this tutorial if I want to display link to previous post in the same category, I can use the following code: <?php previous_post_link('%link', 'Previous in category', TRUE, '13'); ...
2
votes
2answers
59 views

Auto close (hide) custom metabox / set default state

I am using the WordPress function add_meta_box() to add my own custom metabox. So how can I auto close/hide on page open ? Currently, I just add a CSS class closed to metabox's <div> element ...
0
votes
0answers
41 views

Customize wp-caption output

I'd like to customize the output for the wp-caption shortcode. I need to put the attachment full-size URL wp_get_attachment_image_src($post->ID, 'full') function custom_img_caption_shortcode( $a , ...
-1
votes
1answer
33 views

Integrating CSS Into a WP Function Call [closed]

Below is a code I use to display post views. It is integrated with an options panel which allows users to choose whether to display it. I would like to integrate the div class .postviews directly ...
0
votes
0answers
34 views

Wordpress redirect after update profile not saving?

Im using the following code to redirect a user after they update their profile but its not saving any changes that are made (including custom user meta fields).. Any clues? Thanks! add_action( ...
0
votes
1answer
45 views

Countdown to date function?

When a user signs up on my site they have to select a date as part of resignation. On their profile page I need to show a countdown to that date. Something simple like attached. How can I create this ...
0
votes
0answers
26 views

Figure element with multiple image short code

I have a short code I developed that goes like this: [figure description=""] [image src="" title=""][/image] [image src="" title=""][/image] [image src="" title=""][/image] [/figure] What it does ...
0
votes
0answers
31 views

Updating user_meta from pop-up form in back-end

I have created a custom wordpress backend area, which lists out all members on my wordpress site. Currently, there is a point system involved for loyalty rewards, which is maintained in this back-end ...
1
vote
1answer
27 views

Modifying Custom Post Type after registration (will it affect content?)

I have a CPT (defined in functions.php) that I have set to as non-hierarchical. A lot of content has already been uploaded into the database. If I change the definition to 'hierarchical' => true, ...
1
vote
1answer
56 views

echo or print_r in an admin function

I'm currently working my first plugin (to deal with my CPT) and am at the process of saving the values of a meta box. I wish to add an underscore (_) to the meta key so that it is hidden on the ...
0
votes
1answer
19 views

How do you publish a draft on Wordpress

I can't work out how to publish a draft. I go to preview, to check everything's ok, and then there doesn't seem to be any option to do anything more.
1
vote
1answer
65 views

When tax_query used, results disappear (0 =1 produced)

I'm trying to perform a dynamic query that uses a dynamically passed taxonomy and post_type, and displays results accordingly — A user makes a selection from 3 drop-downs on a form, each have a ...
0
votes
1answer
28 views

the_post_thumbnail issues

I am trying to make the thumbnail for each post display on the homepage of a site for a client; although the thumbnails do display, they're not being displayed inside of a specified "thumbnail" div ...
2
votes
1answer
42 views

How can one utilize a variable as a callback function name for add_settings_field

I'm trying to cut down on the amount of code that is in my theme options function. I'm adding my settings like so: add_settings_field($k,$v,$callback,$the_options,$the_group,$args); This works for ...
0
votes
0answers
25 views

How can i Solve this [closed]

Fatal error: Call to undefined function define() in /home/myclasi1/public_html/images/index.php on line 14 How Can i solve this ? I've search a bit on the internet and some guys said that i should ...
0
votes
1answer
51 views

Getting rid of the blog page entirely

My goal is to not use a separate blog page but end up with a structure like this... http://domain.tld/page/comments/ I believe I can do this with the Cornerstone plugin ~ [ ...
0
votes
0answers
47 views

How to execute a function from function.php in a javascript?

I have created a custom menu function in functions.php, but I need to execute it in a container that is created by a javascript. Is this doable? The js is outputting a container called ...
-1
votes
1answer
34 views

Using Schema with `the_excerpt`

I'm currently developing a WordPress site and want to use Schema, I have been some what successful so far but have now hit a stone wall. I want to use: itemprop="description" to the ...
0
votes
2answers
81 views

Show last 5 posts from specific category

I'm trying to show the last 5 posts from a specific category, which will be linked to a function so i can insert the shortcode in a Wordpress page. The code i have is as below, it does everything i ...
0
votes
1answer
34 views

Function Reference for custom link in Admin Menu Management Page

What is the function reference for the text within the URL field in the Admin Menu page? I have a PHP function that is utilizing the_content function reference to look for specific file paths and ...
0
votes
2answers
28 views

Using Output from one Function and calling it into another

I'm trying to get my head around a fairly simple concept in PHP but I'm pretty green. I have a function.. function pa_insertPage($atts, $content = null) { // Default output if no pageid given ...

1 2 3 4 5 25