The server-side programming language that the WordPress core, plugins and themes are written in.

learn more… | top users | synonyms (1)

1
vote
1answer
2k views

Create a new usermeta field for users

How do I create a new usermeta field with a drop down selection values? Im want to create a conditional statement for all users with a certain value of the new custom field I want. For example, The ...
1
vote
1answer
425 views

Create own Wordpress shortcode gallery

How I can handle this shortcode: [my_gallery] img01.jpg img02.jpg img03.jpg img04.jpg [/my_gallery] I can't understand how to write a function, to handle image files name.
5
votes
2answers
4k views

Wordpress Custom Post Types with a page as a parent?

I have a lot of custom type items in my new WP project, and for navigation reasons, I want to make the parent to some of them a Wordpress page. The problem is that apparently, Wordpress does not let ...
0
votes
1answer
93 views

Custom Archive Page

I want to create a custom archive page. It will look like this: 2011 January February March April May June... (Months) May (Current Month) Post 1 Post 2 Post 3 ... And clicked one of months (...
4
votes
1answer
226 views

PHP 5+ stream wrappers with the underlying WordPress File API?

I followed the gsoc project last year from Jon Stacey with great interest only to find out that this project was just the 'base' for a working solution. http://gsoc2010.wordpress.com/tag/stream-...
1
vote
1answer
187 views

Is Auto Post recognition a WordPress feature? How to turn it off?

I noticed that if you go to lostlettermen.com/aa, it redirects to a post. Is this a feature in WordPress that can be turned off, or is this done by some type of plugin or custom code?
0
votes
2answers
462 views

Show label for value only when value exists, basic php

I currently have this, <?php $meta = get_post_meta(get_the_ID(), 'rw_agentPhone', true); echo "office:"; echo $meta; // if you want to show ?> Which is fine provided there is a value for ...
7
votes
2answers
5k views

Any guides on creating custom admin pages?

I basically want to create a table (preferably AJAXified) that lets the user enter a line of information, and be able to add new lines of information, and delete selected ones. I've found this post ...
2
votes
1answer
2k views

media_handle_upload weird thing

I am using a front end script to upload images , all works fine but recently i noticed the uploaded images are not saved in proper directory. My settings are to Organize my uploads into month- and ...
2
votes
1answer
2k views

Publish pending article from front end with a button?

Is it possible to take the blue publish button in back end of the wordpress and place it in the frontend near the post in my index.php. I need a way to publish the pending article without going to ...
3
votes
3answers
993 views

Add Useragent to the body class?

I'm looking for a way to add body class depending on the User Agent of the client with php. I'm looking to implement it this way: page.php: <body id="front" <?php ( function_exists ( '...
0
votes
2answers
293 views

Trying to use Ternary operators with WP Conditionals

Hi I am trying to use ternary operators with WordPress condtionals, using the code below, but it's giving me a PHP error, what am I doing wrong? echo is_home() : '1' ? '0';
2
votes
1answer
790 views

Convert imploded plain text into links

I'm completely open on how to do this: I have the line: echo implode(', ',get_field('categories')); Which is outputting this: Branding, Web, Print I have 20 or so options it can output ...
1
vote
1answer
360 views

Match checkbox data with page title to show certain items

I want to show the projects that has had it's checkbox ticked as Branding, if it's on the Branding page (i.e the page title is Branding). To explain the code a bit: This line show's all the ...
1
vote
2answers
623 views

Wordpress - Display array data of a child

I've used the wordpress plugin - advanced custom field and would like to show an array of a child, here's my code: I'm using this code to show the custom fields data from a specific page ID's ...
0
votes
2answers
372 views

How to internationalize header image?

I have in the following code in the template: <img src="<?php header_image(); ?>" /> However, I want to change this image according to the language selected (through GET parameter lang)....
0
votes
1answer
70 views

Is there any wordpress plugin to upload images and captions to multiple pages once

Hi I have a couple of pages that need the same images and captions, is there a wordpress plugin that would allow this on 1 upload?
-1
votes
2answers
6k views

Call to undefined function issue

I know there are other, maybe better ways to do what I want to achieve, but I have to use this solution. I have two stylesheets: style.css - normal stylesheet style-dynamic.php - dynamic stylesheet ...
0
votes
1answer
49 views

Looking for a good way to include php code in posts, but using special include markup rather than direct php code

Ok, bit of a weird one... I want to include php code on one of my pages within the content by adding something like: Welcome to the payment page [paymentform] Blash blah vlha... And then [...
1
vote
1answer
569 views

Query & Order posts by custom fields

I'm trying to query a custom post type "jogos" where the meta value "data_de_lancamento" (launch date) is <= than today's. That field uses the format dd/mm/yy. The returned posts from that query ...
1
vote
1answer
1k views

What's the proper way to use wp_enqueue_script/style?

First, let me tell you how I'm currently doing it. I have this function. It's purpose is to take the the string of a file system path (/root/web/dir/some/path/to/file) and return the equivalent URL (...
0
votes
2answers
188 views

Plugin error after installation

I'm running WP 3.1.2 on an Apche server with the latest PHP installed. My WP is setup for a subdirectory multisite. The themes for the sites are usually a modified TwentyTen theme. After installing ...
2
votes
3answers
1k views

get_transient(), PHP switch(), and comparison operators

Im using a WordPress transient, which expires after an hour, to store a value which is an integer. Im trying to use switch() and multiple case() statements to evaluate if the transient exists or not (...
0
votes
1answer
915 views

How to use multiple check-box values to work in a function and insert values in database

I am working on a custom theme where there is option to upload images . I have certain check-boxes in the form which the users select as per where the image has to go. My form code is as follows : &...
0
votes
2answers
198 views

How to change a specific character in a theme option value - replace a space with a plus sign

I'm writing a theme where I'd like to give users the ability, via a theme option, to specify a typeface for their site with Google Web Fonts. If a user wants to embed a font like, say, News Cycle, ...
-2
votes
2answers
266 views

Is there any way of not using my_init_method in the following code (that creates a custom post type)?

Mike Schindel provided me this code long time ago: <?php /** * Create the Blocks custom post type and the Sections custom taxonomy */ add_action('init', 'my_init_method'); if (!class_exists('...
4
votes
3answers
4k views

Does an activated plugin automatically mean its methods are available to other WP functions?

I made a WordPress plugin like this: Class MY_CLASS { //codes } Global $myclass; $myclass = New MY_CLASS (); After installed and activated the plugin, can I use this class in other plugins without ...
0
votes
2answers
885 views

Custom Field IF/ELSE PHP

Ok so i am trying to use WordPress's custom fields and have them working but now i have some php code i need help with. <a href="<?php echo get_post_meta( $post->ID, '_ct_text_4dc9e9f74d000',...
1
vote
2answers
986 views

Call External Object in Class Function During Callback

I've a class which has a function that check and creates table in database. In order to do so i need to use WordPress $wpdb object. I need the function to run only on first plugin activation, so i ...
1
vote
1answer
291 views

Detect session/cookie variable in wordpress to prevent access to documents

<?php @session_start(); If (!array_key_exists(‘authed’, $_SESSION)) { include ‘not_authed.inc’; exit(); } // go about your business. ?> and i'm trying to add that to this: <?...
0
votes
1answer
837 views

How to fix this PHP warning in WP-Admin after upgrading to 3.1.2?

I just upgraded from 3.0 to 3.1.2 and in the comments column under Posts in the WP Admin, this error keeps appearing for every row: Warning: number_format() expects parameter 1 to be double, ...
0
votes
1answer
597 views

How to fix these PHP Warnings with the “Feed JSON” plug-in?

I'm getting the following PHP warnings when using the WordPress plug-in "Feed JSON". Can someone tell me how to fix them? Warning: Invalid argument supplied for foreach() in /mypath/wp-content/...
1
vote
2answers
1k views

Best way of adding CSS which can be manipulated by the user via theme option panels?

I thought about adding it as inline CSS with code from the functions.php (not really sure how to do it). Something like this: function addcss() { background: $this_is_the_css_value; } I would ...
0
votes
2answers
749 views

Wordpress Custom Query: Combining Two Functions

I'm a bit new to php and am having some trouble combining the functionality of two custom queries in Wordpress in order to (1) get pagination to work properly, and (2) sort my posts according to a ...
-1
votes
1answer
100 views

What's the .php file which generates the Custom Background page in the admin panel?

What's the .php file which generates the Appereance->Custom Background page in Wordpress' admin panel?
0
votes
1answer
337 views

Crop images in both sides on wordpress [duplicate]

Possible Duplicate: How can I make add_image_size() crop from the top? When generating a thumbnail or featured image the wordpress resize the smallest side and then crop the largest side. I ...
0
votes
1answer
174 views

PHP in Edit Post link

What is the best way to add php to the edit link? For example: insert <?php echo of_get_option('dappo_actionbtncolor', 'dappblue' ); ?> into the span tag of <?php edit_post_link( __( 'Edit ...
0
votes
1answer
1k views

Custom Post Type Causes Error: Warning: call_user_func_array()

I have a custom post type created called 'missions'. When developing the site on my Dedicated Virtual, I had no problems. But I moved the site to a shared hosting grid server (mt) and now receive this ...
0
votes
1answer
393 views

Using theme options to change a border-radius value

I'm developing a theme where I'm using theme options to allow users to set various things -- text size, background colour, link colour, etc. The basic code I'm using for the options is in header.php ...
6
votes
4answers
1k views

Apply class to every paragraph that holds image?

When adding an image to a page or post, Wordpress is automatically adding a paragraph tag <p> as parent holding the image. Like so: <p><img src="my-image.jpg" alt=""></p> ...
2
votes
1answer
128 views

Help with a custom page template - listing contents of childpages?

hey guys, I have no idea how to solve the following problem. I'd love to have a page-template that lists all it's child-pages but with the content. e.g. Imagine I have a page called "WORK. And "Work" ...
1
vote
4answers
2k views

wrong php date()?

hey guys, it's weird and I've never experienced that before. I've created a new blog and a custom theme. I'm using <?php echo date("H:i"); ?>in my theme. The time that's put is 2h earlier. e.g....
2
votes
2answers
2k views

Auto-add paragraphs to custom field?

hey guys, is it possible to format text in a custom field input box automatically with paragraphs? e.g. like the normal text-widget that has the option to say "auto-add paragraphs" when there is a ...
1
vote
2answers
302 views

defining a folder location in order to recall it

I'm creating a child theme off of wp-framework and in it's header it uses <?php echo IMAGES . '/favicon.ico'; ?> to recall the folder where images are kept. How do I define or create the ...
3
votes
3answers
10k views

Add a Jquery Datepicker to custom field in post edit

I would like to add a custom field that is set by a jquery datepicker ui in the post edit panel. Im new to wordpress, so Im not sure how to go about adding something like this. I haven't had much luck ...
8
votes
6answers
3k views

Where to store PHP files created by plugin / themes

There are cases in which a plugin or theme needs to create a php file somewhere that can later include it. For example a captcha plugin, or some kind of a templating system like twig/smarty (In my ...
0
votes
1answer
366 views

Undefined variable _POST

Using 3.1.1 with debug on, I am getting following notice. Notice: Undefined variable: _POST in <filepath> on line 1000 Code at line 1000 is $data = $_POST Why am I getting this notice? ...
1
vote
1answer
334 views

Show css depending on activity type in BuddyPress activity-loop [closed]

I was wondering if anyone knew of a way to show specific styles to the activity loop depending on the activity type? This is what I had an idea of: function mycustom_act_type() { if ('...
1
vote
1answer
421 views

Is there a built in function to see if a URLis oEmbed Compatible?

I want to be able to take a url and see if the domain is one of the ones Wordpress supports to add embeds via oEmbed. Is there a built in function that does this in WordPress or would I need to ...
1
vote
1answer
261 views

How to move all theme templates into a subfolder WP

I'm looking for a wordpress function to move theme's templates into a subfolder (mytheme/templates). Anyone know? The solution can be paid (plugin) or free.