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

Echo post title in post

I am looking to echo the post title at the beginning of each post. I've tried adding the following to functions.php with no luck: function add_post_content( $content ) { if ( ! is_feed() ...
0
votes
1answer
80 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
39 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
2k views

How to display multiple custom columns in the wp-admin users.php?

I'm using the manage_users_columns to display a custom field I create in the usermeta database called company. My code is as follows: function mysite_column_company( $defaults ) { ...
0
votes
1answer
492 views

How can i list current author's categories?

My Code getting authors written post categories but just 2 ID has author lists category.. I replace $current_user->ID but it is not worked. <?php $categories = $wpdb->get_results(" ...
0
votes
1answer
51 views

How to list posts that appear in two categories

I would like to list all posts that appear in the current category being viewed that are also posted to a second category. Example Pictures : LINK For instance, a listing of the common posts between ...
0
votes
1answer
155 views

Wordpress get_avatar function not correct working

My code doing this, listing which author have posted in the current category. But get_avatar function not correct working. Im Using Simple Local Avatar Plugin. It is working author.php don't have any ...
0
votes
3answers
113 views

Need help “sanitizing” a custom function that pulls category slug into body class

Not sure if "sanitizing" is really the correct phrase to use for this but it was the best one I could think of...anyways, here is the problem: My function works great like so... // add category id ...
0
votes
1answer
117 views

Change Rating range in Link Manager

I have looked in here and across the internet but I can not seem to find an answer. Is there a way to change the values of the ratings. By Default it seems to be 0 to 10, but I can not find a way to ...
0
votes
1answer
583 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 ...
1
vote
1answer
593 views

How can I change a function in a parent theme via a child themes functions.php

I have a function in a parent theme: function cyberchimps_logo_icons() { ?> <header id="cc-header" class="row-fluid"> <div class="span7"> <?php if ...
0
votes
1answer
232 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
135 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
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 ...
1
vote
1answer
256 views

Can the wp-plugins (Must Use Plugins) URL be targeted for use in functions.php?

Can the wp-plugins (Must Use Plugins) URL be targeted for use in functions.php? I have a mu-functions.php file in the mu-plugins folder. One function calls a javascript file (alerts.js) located in ...
0
votes
1answer
471 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 ...
1
vote
1answer
111 views

Frontend tag edit/submit form

I would like to have a separate page to submit/edit tags. Any user can edit or submit tags. But it should be published only after admin approval. Is there any function available like ...
1
vote
1answer
137 views

list tags with count in author profile page

I would like to list tags with count in author profile page just like this page If the user click the tag, then I would like to list the tagged posts. Can someone help me?
1
vote
1answer
143 views

Restore Image Title Text

In WordPress 3.5, when images are inserted into posts, the title attribute is not included in the image tag. The Lightbox plugin I am using requires the title tag to be present on images; besides, I ...
1
vote
2answers
342 views

How to activate “Description” metabox for menu item programmatically?

I'm creating custom wordpress theme. How can I enable "Description" metabox for menu items (on nav-menu page) by default programmatically?
3
votes
1answer
95 views

How to prevent deleting of comments when deleting a post

Like the title says: How can i prevent Wordpress from deleting post comments when i delete a post? What i am trying to accomplish is that i want to merge all comments from different posts to posts ...
0
votes
3answers
280 views

Display a custom field rating system in the front end

I have added a content rating system to my platform where the authors can select which audience their post is appropriate for. Currently, these options are available: Unrated G PG ...
0
votes
1answer
219 views

Add a jQuery Function

Forgive me for knowing next to nothing about coding. BUT, I am calling jQuery in functions.php, which I have been told is the best way to include jQuery: //Get jQuery function modify_jquery() { ...
0
votes
1answer
233 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
165 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
142 views

Adding a pagenavi to function for displaying bookmarks

I have a plugin user bookmarks - see here - and I'm trying to add a to it so the bookmark posts don't pile up like crazy. How can I do it? This is the function that displays the bookmarked posts. ...
2
votes
1answer
247 views

Multisite, either change the name of sample-page or create new page

Is there a way to either change the name of the default Sample Page or create a new page entirely everytime a user creates a new blog on WP multisite?
6
votes
1answer
1k views

Set media upload attachment link to none and hide it in WP v3.5

In the Media upload popup page, how do I set the attachment link to none and hide it in Wordpress version 3.5? The following filter worked fine in earlier versions of WP: function ...
0
votes
1answer
202 views

Stripping and/or altering the content of a custom field (video URL)

I’m making a theme where some posts have an associated video, from either Vimeo or YouTube. At the moment, users can add this to a post by adding a video ID into one of two custom fields, called ...
3
votes
2answers
367 views

How to get comments with mixed status using get_comments?

Is there a way to get comments with more than one status using get_comments function? Let's say I would like to get both trash and hold comments. It is possible to do the same with posts: ...
1
vote
2answers
476 views

when I fetch data from remote mysql database in wordpress built in wordpress function is not working?

In one of my page I have to fetch data from remote mysql database. We have connection to remote mysql database by creating new instance of $wpdb class. $mydb = new wpdb(DB_USER2, DB_PASSWORD2, ...
2
votes
2answers
1k views

Advantages and disadvantages of using automatic-feed-links

What are the advantages and disadvantages of using add_theme_support('automatic-feed-links') in my functions.php file?
0
votes
1answer
210 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 ...
1
vote
2answers
707 views

Twenty Eleven Child theme error when attempting to use a rewritten function

I attempted to make a minor change to a function in the Twenty Eleven theme (wordpress 3.4.2) I get this error message: Fatal error: Cannot redeclare twentyeleven_widgets_init() (previously declared ...
3
votes
2answers
98 views

How to count number of functions attached to an action hook?

I have some actions like this function simple_notification() { echo '<div>This is a notification</div>'; } add_action( 'site_notices', 'simple_notification' ); ...
0
votes
1answer
2k views

Isotope Drop Down Categories Filter Function

I have a code in my functions file that I am using to generate a list of categories so that I can use isotope to filter the current page. However I need to know how to - How to make it a drop down ...
0
votes
1answer
246 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 ...
7
votes
2answers
2k views

Remove “Insert from URL” link in Media upload - WP 3.5

How do I remove the Insert from URL link in the new Wordpress 3.5 Add Media popup page? In earlier versions of Wordpress, this worked fine: // removes URL tab in image upload for post function ...
1
vote
1answer
85 views

User meta and author meta

Here's what I have so far.. class emailer { function notifyHeart($post_ID) { $interests = get_user_meta( get_current_user_id(), 'interests', TRUE ); $to = the_author_meta( 'user_email', ...
0
votes
1answer
30 views

Retrieve current post's tags

Is it possible to use get_post() to retrieve which tags were selected in the post? I would like a way to store a single post's tags into a variable.
0
votes
1answer
150 views

error in getting post id

I am making a voting system The problem is that the post id Is returning blank I am sure that post id is returning blank Bcoz when I put a real post id value there it seems working For example ...
-1
votes
1answer
66 views

filter just a portion of plugin function

I'm trying to edit just a few pieces of bbpress' breadcrumb default settings, but the filters I've tried end up replacing the whole function. How do you replace only bits? Here is the filter as it ...
4
votes
2answers
224 views

Notify users whenever a new post is published based on their preference

I have put together a custom registration form on my WordPress site and one of the items on the registration form is an ability to select an interest. Essentially I have the following code from the ...
0
votes
1answer
371 views

What is the Difference in bones_comments() and comments.php

I started to use Bones HTML5 Wordpress Starter Theme, but a little confuse with some built-in function in bones, There is function bones_comments() in functions.php but I cannot find anywhere on the ...
1
vote
1answer
93 views

Post meta not updating

I am trying to make a voting system for WordPress. This is my code in functions.php: add_action("wp_ajax_add_votes_options", "add_votes_options"); add_action("wp_ajax_nopriv_add_votes_options", ...
0
votes
1answer
518 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
268 views

ISOTOPE - Missing/Invalid Arguement Get Terms

I am trying to use the isotope plugin for sorting on my taxonomy page and even though I don't know much about how to set it up, I tried using some advice found on here. Wordpress and isotope ...
1
vote
0answers
157 views

Save modified Custom Field content into another Custom Field on article save [closed]

In my articles I allow editors to enter a date in a human readable dd.mm.yyyy format into a custom field. But I also need this date as unix timestamp in the DB. So I wrote a function which takes the ...
0
votes
1answer
267 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
2answers
131 views

Show one post per author and order by custom field

I display one post per author with function below and works fine, but is possible order by custom field? <?php add_filter('posts_groupby', 'author_groupby'); function author_groupby($groupby) { ...