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

Menu not styling. New menus functionality giving me a headache

I can't find a good tutorial on the new menu handling functions, and the ones I found don't seem to work for me. What am I doing wrong? In my functions.php: (I'm using the Blank Slate theme as a ...
0
votes
1answer
896 views

How to make excerpt image be full size instead of thumbnail?

Now when I have excerpts on the home page the image is a small square, but I'd like to change it to a fill the entire width of the content area. (as if the image was in a post.) My theme is responsive ...
0
votes
1answer
574 views

Get date function not working

I have a function to get the date. I have input fields and want the date in this fields. But my code is set a wrong date. I set the date in Wordpress settings and on my server. But it is not working. ...
0
votes
1answer
741 views

Replacing global wp_query

I have a site that uses a custom query to search for posts by country. The search results come back fine, but the pagination at the bottom reflects the total number of posts in the site, instead of ...
0
votes
1answer
1k views

Should I use add_filter for functions in function.php of the theme?

I have written few functions in the function.php file of the theme. Should I use add_filter function for those functions?
0
votes
1answer
1k views

show all the posts thumbnails

I want to display all the posts by the featured image of each post. Is there a shortcode or can you give me some tips on how to achieve this ? Thanks!
0
votes
2answers
1k views

How to set the default avatar of buddypress avatar [closed]

I need a way to set the default avatar for buddypress's bp_core_fetch_avatar. Using the regular get_avatar you can just set the $default path but I can't find anyway to do it with buddypress's ...
0
votes
1answer
314 views

How to add custom function to pluggable.php

I am working on a WP plugin and I want to add a custom function to pluggable.php (located in /wp-includes). I am calling that function from admin.php (located in /wp-admin) eg. Consider the function ...
0
votes
1answer
162 views

Making a wordpress page print friendly

I'm trying to use an existing plugin in order to make my posts print friendly. I haven't got any support from the plugin developer. I think I have narrowed down the script to the function that places ...
0
votes
1answer
272 views

Allowed memory size of 33554432 bytes exhausted (tried to allocate 9967617 bytes) in …\wp-includes\functions.php

When a script times out, and there is nothing you can do about it ( cause it's running on a bloddy shared hosted resource where you have 0 control over the script time-outs ), can you run register ...
0
votes
1answer
3k views

How to get data from an array using get_user_meta()

I have created a custom user profile field <?php $basics = get_the_author_meta( 'fbasics', $user->ID ); ?> <ul> <li><input value="lesson1" name="fbasics[]" ...
0
votes
1answer
643 views

Problems with functions.php! Error! [closed]

Suddenly I got the message: Parse error: syntax error, unexpected T_CLASS in /home/spandabe/public_html/wp-content/themes/modularity-lite/functions.php on line 72 when opening my site ...
0
votes
1answer
62 views

Output comment_author in array

In functions.php for part of custom comments, I have the following echoed array as the link to respond to a previous comment: <?php echo comment_reply_link(array( "before" => " <span ...
0
votes
1answer
1k views

How to hide image-url if no attachment?

How can I hide the img-tag if there is no attacment? (function is from this tutorial: http://wp.tutsplus.com/tutorials/automagic-post-thumbnails-image-management/) <img src="<?php ...
0
votes
1answer
75 views

Help with IF has focus then… statment

in a sidebar I have: <div id="my_id"> [shortcode]</div> It outputs a title that when hovered on drops down to show a menu. When hovering on the title a background color shows up and ...
0
votes
1answer
370 views

Changing the text of Upload/Insert on Posts and Pages Screen

In wp-admin/includes/media.php I found this: function media_buttons($editor_id = 'content') { $context = apply_filters('media_buttons_context', __('Upload/Insert %s')); $img = '<img ...
0
votes
2answers
172 views

How to change a specific admin label

I'm trying to change on the backend from: Appearance -> Header To Appearance -> Logo But the Changing Admin Menu Labels answer didn't help so far. Any new tip? Thanks
0
votes
1answer
265 views

How d0 i get the number of attachments in the post

Is there a function that allows me to get the number of photo's attached to a post and that also grabs the url of the first attachment to go to the attachment page for each post? Here is an example ...
0
votes
3answers
833 views

struggling with syntax for the_post_thumbnail();

i want to display the alt text for a featured image. I've been using the the_post_thumbnail(); function to display the image like this: if ( has_post_thumbnail() ) { // check if the post has a Post ...
0
votes
1answer
144 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. ...
0
votes
1answer
206 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 ...
0
votes
2answers
939 views

Best way to style first post differently?

I am building a custom (child) theme and I want to style the first post of my loop in a different way than the others (bigger image, different position of some stuff). Which is the best way of doing ...
0
votes
1answer
245 views

Use of antispambot with $curauth->email

This is probably pretty simple, but... I want to use the WP function antispambot not on get_the_author_email but on a value in a field I added to User Profile called publicemail. Everything I've ...
0
votes
1answer
488 views

Function to allow single post template based on custom taxonomy?

I'm trying to use Justin Tadlocks function for category specific custom post templates, but have become stuck when trying with a custom taxonomy, as his examples only have normal categories. Can this ...
0
votes
1answer
612 views

Adding tables to dashboard pages programmatically?

I think that is not possible with some actions or filters, I know that I can do it just with html and using right css styles, and of course php to achieve what I need, or to write some minde actions. ...
0
votes
1answer
83 views

include w_thumbnail_src in function?

I got a function that automatically creates a custom field in the post. I have this located in my functions.php. Image is the name of the custom field and HERE is the value. How can I put the ...
0
votes
2answers
74 views

implementing a centralized content “show-do-not-show” toggle?

I have many custom templates for different post types, and I am manually inserting a social share bar inside the 'entry-meta' footer in each of those templates. I need a simple centralized way to ...
0
votes
1answer
109 views

grab or load text on demand

What i want to do I want some content (could be stored any where in a post or custom field) to load only when the user clicks for it to load. This content could be any thing (text,images,html etc) ...
0
votes
1answer
940 views

Submit Custom Postypes from frontend

I am attempting to create a form that submits data and creates a post with custom fields filled. What I would like to do in step form. 1) Create a custom posttype function called "pickups" (I do not ...
0
votes
1answer
464 views

Auto create Nextgen Gallery on post creation [closed]

I was wondering if there is a way to create a nextgen gallery with a function, so that I can hook that into my front end post creation setup. The gallery could be completely empty or be created with ...
0
votes
1answer
353 views

Multiple, Dynamic, Sidebars Problem - First Sidebar not working properly

This is my function: function ec_register_sidebars() { register_sidebars( 3, array( 'name' => 'Sidebar %d', 'id' => "sidebar-$i", 'before_widget' => '<li id="%1$s" ...
0
votes
1answer
256 views

Setting post_id for single.php based on URL without a redirect

I'm migrating a Joomla! database to Wordpress and the website has to remain exact regarding URLs. The Joomla site has its posts with .html extensions, and the importer I created maps the Joomla file ...
0
votes
1answer
91 views

A better way to get stats

I'm not looking for an specific answer but more of a general direction. Recently I decided to make my own stats plugin. I know there are tons out there, but I wanted to make my own. I figured, how ...
0
votes
1answer
203 views

Looking for Functions File that doesn't Exist

My WordPress site seems to be running fine, except that trying to go to the plugins page gives the following error: Fatal error: Cannot redeclare _verifyactivate_widgets() (previously declared in ...
0
votes
1answer
956 views

hook for dashboard show_user_profile

I'm looking a way to avoid regular users go to profile and dashboard page. Have this little code to work with profile page: function lockdown_profile() { global $current_user; return ...
0
votes
1answer
3k views

How to add a shortcode to call a function

I'm using Cimy User Extra Fields to add more registration fields. I'm also using Contact Form 7 Dynamic Text Extension to pre-populate contact form fields. I've read, in order to be able to use Cimy ...
0
votes
1answer
692 views

How can I call a PHP function inside a hardcoded shortcode?

Maybe I'm doing this the long way but I need to make something like this: <?php echo do_shortcode('[mu-events months="11" startmonth="today" orderby="time" orderas="ASC" sites="?> <?php ...
0
votes
1answer
920 views

Uses for function: wp_update_user

my theme currently uses the wp_update_user function to update a set of user metas. I created to some new user meta fields that I would like to include in the existing wp_update_user. The function ...
0
votes
1answer
1k views

Wordpress multisite,use same cookies across all website?

Hi is this posible to use same custom cookies across all blogs?Can someone help me with this?
0
votes
1answer
118 views

How would I make a function to dynamically determine if user is logged to change navigation menu text?

I would like to create a function to determine if a user is logged in or logged out. If the user is logged in I would like the navigation menu text to say "My Account" (this is what it currently ...
0
votes
1answer
647 views

using admin functions on frontend

I'm updating my plugin to rely on internal functions of WordPress. I'm about to use wp_generate_attachment_metadata, but this function seems to be only available in the admin section. Is there an ...
0
votes
1answer
946 views

Enqueue script on every page except one

I want to load my javascript and exclude 1 page, so I tried the following without success: function mypage_scripts() { if ( !is_admin() ) { wp_deregister_script('jquery'); ...
0
votes
1answer
103 views

Wordpress comment_form() does not display actual comments

Maybe I did not understand the role of comment_form(). After pasting this in my wordpress single.php I get just the form for submitting comments but NOT THE ACTUAL COMMENTS. Is this a bug, or the ...
0
votes
1answer
77 views

Any adverse effects of adding apply_filters to a function?

I'm going back through my older WordPress theme and making the functions filterable and also adding the function_exists checks. Is there anything I'm not thinking about that this may cause problems ...
0
votes
1answer
82 views

Javascript Function Called Too Early in PHP Script

I'm working on a Google Maps plugin. My problem is that the function that initializes the map, csf_map_maker_js(), is getting called too early-- before the div is defined (at least that's what I ...
0
votes
1answer
397 views

How do I call an external php non WordPress class into functions.php?

All my WordPress files are in: /httpdocs/news/ and the classes I want to call are in: /private/classes/ Would I use the include_once() function or is there a WordPress function? And how would I ...
0
votes
2answers
411 views

Wordpress Categories: Function using custom SQL to return array of specific category IDs

I'm developing a custom theme which uses categories for positioning, all of which begin with an underscore (e.g. _position1). I have an SQL query as below to get a list of these categories (those ...
0
votes
1answer
100 views

How can I remove page titles without removing the link in the navigation bar in twentyeleven?

I 'd like to remove the titles from every page in my blog. But the title in de navigation balk must stay of course. Any idea? Please explain as easy as possible :-) cause I 'm taking my first steps ...
0
votes
1answer
376 views

Need help with Custom Post Types and Taxonomies

I'm trying to get my head around CPT and Taxonomies. I've created a section on my WP site called Work and so I've got this in my functions.php file: add_action('init', 'work_register'); function ...
0
votes
4answers
306 views

Problem with <code> tag

Where you can see it: http://themeforward.com/demo2/functional-codes The first button is my code, as it should appear. The second button is within <pre><code></pre></code> ...