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

learn more… | top users | synonyms (1)

1
vote
2answers
566 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
335 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 ...
0
votes
1answer
69 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
4k 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
45 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
558 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
827 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
183 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 ...
3
votes
3answers
863 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
636 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
182 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
257 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 ...
4
votes
2answers
3k 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
774 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, ...
1
vote
2answers
852 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
286 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
767 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
477 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 ...
0
votes
2answers
960 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
726 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
98 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
299 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. ...
0
votes
1answer
170 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
383 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
794 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
127 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
1k 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. ...
2
votes
2answers
1k 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
283 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 ...
2
votes
3answers
8k 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 ...
6
votes
6answers
2k 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
306 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
316 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
377 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
245 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.
1
vote
1answer
674 views

Is sanitize_title_with_dashes formatting function too liberal (in terms of accepted characters)?

sanitize_title_with_dashes (see code below for reference) is the function Wordpress uses to format "pretty" urls. However, contrary to the function's comment header, it allows much more than ...
0
votes
2answers
2k views

if plugin is active? check if plugin is enabled or not?

I'm using the mingle plugin and the mingle-forum plugin. I want to show a certain part on my site only if those two plugins are active. How can I solve this? <?php if ( ...
2
votes
1answer
199 views

Browser title script ignoring is_page /else conditional [closed]

I've used this code to stipulate different separators for different pages in my clients site: <title> <?php if(is_page('Portfolio')){ wp_title( 'of', true, 'right' ); echo ...
1
vote
3answers
248 views

wordpress upgrade has broken my permalinks

I have just upgraded my wordpress installation from 3.1 to 3.1.1 and my custom structure permalinks are now broken, The permalinks were set to follow this procedure, /%category%/%postname% ...
0
votes
3answers
2k views

Use PHP in stylesheet to specify a background image based on Category ID

In my stylesheet I'm hoping to use code like this... background-image: url(/wp-content/images/' . $category->cat_ID . '.jpg); ...to pull in a different background image for each category. So ...
1
vote
1answer
861 views

Wordpress 3 - how are passwords stored and how do I compare to them?

For reasons I can't go into right now, I'm creating a form that will allow users to change their passwords for Wordpress by entering their current password and then entering the new password. I want ...
0
votes
2answers
204 views

Removing the first 8-10 letters from a post?

I have a widget that shows all the post names. All the post names are "Chapter ## - Title" I would like the php in the widget to remove the "Chapter 1 -" or "Chapter 12 -" for example so that just ...
2
votes
1answer
2k views

urlencoding of the_title() doesn't work?

hey guys, <?php urlencode(the_title()); ?>doesn't take effect. this is my entrie line of code: <li><a href="mailto:?subject=<?php urlencode(the_title()); ...
4
votes
4answers
814 views

Separate Wordpress themes for each category page

I've read http://codex.wordpress.org/Category_Templates, which tells you how to change your index.php for each category. But I want to load a whole different theme directory in for my site when a ...
4
votes
3answers
265 views

Is there a browser plugin or method to find which php template an item is coming from?

Is there a browser plugin or method to find which php template an item is coming from?
1
vote
2answers
3k views

page template for attachement page?

hey guys, I couldn't find anything on the web. Is it possible to have custom template for the image attachement page. I wonder if it is possible to add a navigation to the image attachement page so ...
0
votes
2answers
140 views

Building a Wordpress App

I construction of a administrative back office inside the wordpress theme for running our travel company, monitoring users, bookings and payments, it has come to my attention that it might be better ...
0
votes
2answers
1k views

Wordpress function when file is uploaded, deleted or edited

I need to call this bit of PHP when a file is uploaded, deleted or edited. $output = shell_exec("bash ./upload.sh"); echo $output; I can't seem to find the right code to execute this when any of ...
2
votes
1answer
3k views

adding a filter to a shortcode?

<?php echo do_shortcode('[mingleforum]'); ?> inserts the mingle forum into my content! is it possible to use add_filter() on that?