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

How to place a div inside a function that creates a div

I am wondering how instead of having the menuTab div come after the bones_main_nav function html code that is outputted to have it injected inside of it I suppose. I have the following function // ...
0
votes
1answer
91 views

Post Views Code Hacks

// Post views function getPostViews($postID){ $count_key = 'post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ ...
0
votes
1answer
43 views

Closing WP_LINK_PAGES DIV ID w/After Argmuent

In my code below I need to close the div "link_wrap" which I created with $args['before'] = '<div id="link_wrap">'; When I try to paste $args['after'] = '</div>'; above return $args; it ...
0
votes
1answer
120 views

Unable to Change “Pages:” Before WP_LINK_PAGES

Below is a functions.php code for wp_link_pages which allows pagination and previous/next links to be displayed. It also wraps each pagination link in a span class called "classlinks". I need to ...
0
votes
1answer
288 views

colorbox not loading in <head>

I can not get colorbox fully loaded. I am trying to add color box to use in my plugin admin. I do not need it for the front end. I can get the css but can not get jquery.colorbox-min.js or the ...
0
votes
1answer
195 views

dynamic enquiry form [closed]

I'm thinking to use Contact Form 7 to create a simple enquiry form like : name, phone, email. This enquiry form will be displayed on every portfolio page. What I want to do is to retrieve also ...
0
votes
1answer
763 views

Aspx/Rss feed - failed to open stream: Redirection limit reached

I have this issue ive been stuck with now. Its when i load a page that have a feed. I put the feed in wp-admin , this usually work with other feeds but not sure why its not working with this kind of ...
0
votes
1answer
41 views

Adding an Unlinked Space in a Custom Function

This question has been a pain in my side for the last few days. I am using a function to display page numbers and next/previous links with WP_LINK_PAGES. The code I'm using (below) is a shortened ...
0
votes
2answers
122 views

exclude custom post type from running a function

I have the following code in my functions.php file to display post shortlink in my posts (I prefer not to edit theme files if possible)... function add_post_content($content) { if ( is_single() ) ...
0
votes
1answer
592 views

wp_get_archives() output

Iv got this code in my blog.php: <?php wp_get_archives( array( 'type' => 'monthly', 'limit' => 12 ) ); ?> It links to: /2013/01 My page only loads the header and footer - I think ...
0
votes
1answer
339 views

Remove Permalink Meta Box not working?

For some reason the slug / permalink meta box is not being removed on the Edit Page screen. Code in functions.php function mjp_edit_meta_boxes() { // Remove Meta Boxes remove_meta_box( ...
0
votes
1answer
226 views

Taxonomy term description with style, only if the description exists?

I am attempting to add a conditional function to my index.php that will return the description of a term in my custom taxonomy on the page for that term above the list of posts only if the description ...
0
votes
1answer
222 views

I would like single.php to act just like index.php

I'm creating a WordPress theme for my portfolio and I would like to my single.php file to act just like the index.php. I need the single.php to show the entire loop but if I access single post's page ...
0
votes
1answer
264 views

Conditional function for excluding first image from content, not working

I have the following function: function remove_images( $content ) { if( ( is_category() || is_archive() || is_home() ) && has_term( 'MyCat', 'category', $postID ) ) { $postOutput ...
0
votes
1answer
749 views

Function to add custom HTML into head in custom post-type list page

How can I add custom HTML/PHP file into head where custom post-type list showing like this ? Any Wordpress function can do this ? or I can only do by JS(jQuery) to append my custom content ?
0
votes
1answer
353 views

Does Wordpress has an automatic link parse function?

Does wordpress has an automatic link parse function? I want the HTML to be generated automatically when writing www.url.com -> <a href="www.url.com">www.url.com</a>
0
votes
1answer
159 views

Adding a Tag Parameter / Filter to My Shortcode

I have this plugin that displays category featured image thumbnails for each post via shortcodes.. like so, [categorythumbnaillist 3] (3 being the category of course) I would like it to only show ...
0
votes
1answer
533 views

Fatal error: allowed memory size when after using enqueue_script

I an trying to enqueue four script files and keep getting this error: Fatal error: Allowed memory size of 103809024 bytes exhausted ... wp-includes/class.wp-dependencies.php on line 175. I used ...
0
votes
1answer
604 views

AJAX function not working [closed]

One person on the site wrote a function, but I do not know why it works. This function displays a random quote. The functions implemented the ability to download new quotes via AJAX (link New Quote), ...
0
votes
2answers
227 views

Using locate-template & shortcodes doesn't appear to work

For organisation, I'm trying to split up the functions.php file into separate files. In particular the functions for shortcodes in a separate file, with the shortcodes being defined in functions.php. ...
0
votes
1answer
600 views

More gentle way to hook Wordpress custom url

I have written a plugin named foo, and I want when user typed url /hello and it will display the string world There is an existing post which uses the following code if ($_SERVER["REQUEST_URI"] == ...
0
votes
1answer
501 views

The work of Wordpress Function update_post

I use wp_update_post() in a Frontend Page. The first part of the function works as expected. post_content and/or post_title will be changed in wp_posts. But the function does not create a revision ...
0
votes
1answer
648 views

Call javascript functions from each page

Is there a plugin that supports calling custom functions that you've created? Like, page A -- I want to call function x $(document).ready(function(){ call_function_x() }); page B -- I want ...
0
votes
2answers
2k views

How to use the do_action () with parameter

I am trying to trigger an action in functions.php with the do_action() function, but I appear to need an attribute. The following do_action( 'really_simple_share button="facebook_like"'); does not ...
0
votes
1answer
5k views

Can't call Javascript function - scope?

I get a method not defined error when trying to call a function loaded with wp_enqueue_script from site.js. I'm guessing it's because of scope caused by the jQuery ready wrappers? How do I get ...
0
votes
1answer
2k views

Set WordPress Default Template

I'm using the Options Framework Theme to put together my options page and would just like to know how would I set up/call the Default Template - for whichever one the user has selected. For example, ...
0
votes
1answer
760 views

Sorting custom post types in edit.php : Post disappear

I've got a few custom post types with different taxonomies and I have a function that adds certain categories to post list view in edit.php admin screen. Everything good there. I've also added a ...
0
votes
2answers
244 views

Change Default Content when Creating a Post based on Previous Category Choice

I'm working on a system that forces users (unfamiliar with wp) to choose a category before creating a new post, and then adds some appropriate html layout styling to help them. The following code ...
0
votes
1answer
437 views

Custom attributes to javascript tags

My site uses cloudflare but I really want to enable rocket loader, but if I put it on automatic mode, it messes up my whole site... So I googled and found This answer which has helped in terms of ...
0
votes
2answers
511 views

Hide custom fields when empty

I am trying to create a function to add data from two custom fields after the entry title. I get it to show correctly when these fields are filled in. The fields are a image source url and an url the ...
0
votes
2answers
3k views

How to add php within jquery

I want to add php code within jquery. I know that the file then cannot be saved as a js file but must be saved as a php file to execute the php code. If we save it as a php file then it can also not ...
0
votes
1answer
358 views

Testing for a shortcode using a function. 404 page throwing PHP Notice

I'm using the following function (can't remember where I found it, but I think it was written by pippin so thanks to him) to test for a shortcode. function has_shortcode($shortcode = '') { ...
0
votes
2answers
103 views

Check if a different page has any attached images

I am trying to make a notification function for a user's account dashboard that displays if they have not added any images to their profile's gallery. I found this page, which is a function that ...
0
votes
2answers
46 views

How i can get the URL?

How i can get the base URL in the wordpress? get_bloginfo('url') returns me the current URL. I just want the base URL e.g http://localhost/wpsite/ not any ?page_id=123 with it
0
votes
1answer
1k views

How to add first name, last name and company name to my custom registration form

I´m trying to add first name, last name and company name to my custom registration page. The registration form almost works, but there is a problem. So far I´ve got this code, but I cant get the ...
0
votes
1answer
322 views

Add_image_size not generating correct size

I have 2 additional image sizes i've added to my theme and the for some reason when I use the Force Regenerate Thumbnails plugin, my images are created but the files sizes are not exact. Here is the ...
0
votes
1answer
142 views

Custom Menu in Admin doesn't change menu in browser

i've just begun participating these stack overflow forums yesterday and had a great experience with someone who could problem solve with me. working from the admin panel under the themes tab i have ...
0
votes
1answer
800 views

Show errormessages on wrong username/password on custom loginform?

I use this simple HTML loginform in my sidebar. Does anyone have any clever way to make it show the errormessages when you type in wrong password or username? <form action="<?php echo ...
0
votes
1answer
697 views

How to add a custom thumbnail size for a specific category?

The default thumbnail size for the Wordpress theme I use generates category thumbnails for the homepage and archive page at 200x110px. I would like to add a custom thumbnail size for a specific ...
0
votes
2answers
355 views

Function to check if custom page is used by page?

I have template-clientlist.php now I search on wordpress doc but can find a function on how to check if page used template-clientlist.php template-clientlist.php <?php /* Template Name: Page Of ...
0
votes
2answers
548 views

How can I show different content for different user-levels?

Can I use is_user_logged_in to manage content for different roles? Example: If subscribevr user is logged in.... show content.... else show "you are not logged in" and on anonther page if ...
0
votes
1answer
721 views

Customize field names in backend profile edit page through function.php [duplicate]

Possible Duplicate: How To Add Custom Form Fields To The User Profile Page? I want to change a the names of some of the fields in the edit profile page in the backend. For instance, instead ...
0
votes
1answer
384 views

Wordpress function bloginfo not echoing output on parts of the pages

I'm having a bit of a problem with the bloginfo() function in Wordpress which I've never had before. Normally I use <?php bloginfo('template_directory'); ?>/rest of image link here but for ...
0
votes
1answer
118 views

Make table disappear when fields are left blank?

I made a table out of the fields in a custom meta box I created, but now I'd like to know if I could have the table disappear if none of the fields were filled in. Is this too complicated, is there a ...
0
votes
1answer
73 views

Running a function only once when a taxonomy term is changed

Probably quite a simple problem.. I have a custom post type with taxonomy terms. I wish to run a function from my functions.php whenever the admin ticks a specific term box. My original thought was ...
0
votes
1answer
751 views

Page template that uses lightbox to display post images

I have created a page template that displays the featured image for all posts of a certain custom post type. It uses a normal loop that is querying that specific custom post type. The thumbnails are ...
0
votes
2answers
78 views

display custom post on separate page

I have been able to register a new post type. 'code' and now I would like to display it. I added add_filter( 'pre_get_posts', 'my_get_posts' ); function my_get_posts( $query ) { if ( is_home() ) ...
0
votes
1answer
2k views

get excerpt without images

Is there any way to not get the images with get_the_excerpt()? I am using a my_recent_post() function to pull posts onto the home page and I don't need to have it pull the images within the posts, ...
0
votes
2answers
363 views

Wordpress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?

I wonder if Wordpress is the best CMS or solution for what I wannt to do? I need to find some way to upload images to a post that I can loop as background images. Just like I can upload multiple ...
0
votes
1answer
155 views

Post type Echo code is repeating on homepage

Hi i'm using this php code that allows me to call a div in different post type, but the only problem is when i add a second line instead of it showing only on the post type page it shows on the home ...