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

learn more… | top users | synonyms (1)

0
votes
1answer
54 views

include <p> content within conditional statement?

I have a gallery page wherein there are multiple individual galleries/sub-pages. I handle this function by using- <?php if( is_page( 39 ) ) { echo do_shortcode('[nggallery id=1]'); ...
0
votes
1answer
362 views

How to keep track of when a vote is cast?

I have setup a great voting system on my website, but since I want to sort the top rated posts by week, month and alltime...I now need to able able to keep track of when a vote has been cast. Could ...
0
votes
1answer
6k views

Add a Second Menu to a theme that only support 1 menu

I am no programmer but I can usually work stuff like this out when I read the code. I have a theme called Infinity which only supports 1 menu. I know how to do CSS etc but I can't find how I would a ...
1
vote
1answer
1k views

How to target with css, admin elements according to user role level?

I am using plugins "Capability Manager Enhanced" and "Adminimize". Between these two I have been able to do much of what I want to do. There are still some elements I need to hide and have been able ...
-1
votes
1answer
932 views

PHP-Code inside Href-Tag

I have include PHP-Code inside a href-tag – and it doesn’t work! <?php $image = get_post_meta($post->ID, 'image_medium', true); if ( $image != '' ) {?> <a href="<?php ...
-1
votes
1answer
255 views

Null value given when confirming email's

Fixed the problem by adding if ( 'email' == $type || 'email2' == $type ) { to the top of the snippet below and changing the first elseif to a if statment I have created a WordPress register form on ...
0
votes
2answers
512 views

trouble with page_id & highlighting current page

I'm using the below code to highlight the page name/gallery shown when the corresponding link is clicked on. My challenge is that regardless of what link I click, only the very first ...
0
votes
1answer
234 views

What does $2$3 mean? [closed]

Came across a line in some Wordpress code I am modifying and just flat out don't know what the $2.$3 is? Maybe it's a PHP thing that I just never learned? Can anyone explain this to me? Here's the ...
0
votes
1answer
52 views

How can I fix this, i get an error 404 when i acess the second page of post-type

How can I fix this, i get an error 404 when i acess the second page of post-type www.site.com/clipuri/2012/ www.site.com/clipuri/2012/page/2/ register_post_type('clip', array( 'label' => ...
2
votes
3answers
8k views

woocommerce and is_user_logged_in() if not redirect to homepage

I am currently using woocommerce and would like to redirect none logged in users to the home page, however i am having a little trouble determining where i should implements this I have done research ...
0
votes
1answer
314 views

Accessing Global Vars & Functions in custom php page

I have created a php page called "test.php" and uploaded this file to the root folder of my wordpress installation. This file contains only this: <?php if ( is_user_logged_in() ) { blah..... } ...
1
vote
0answers
138 views

check if comment submitted was successful

I want to use php to understand if comment submission was successful. Is there any get/post data I can use to make if function for this?
0
votes
1answer
273 views

How do I filter a custom post type loop by a field?

OK, very simple task, I'm just not good at PHP. I have a page where I want to list some staff using a styled list. Here is the page all working fine, I just need to divide the results - ...
5
votes
2answers
1k views

Adding a custom image upload size and making it selected by default?

How can I add a custom image upload size with a width of 550px and make it selected by default in the Add Media page? Currently, there are 4 sizes available: Thumbnail, Medium, Large and Full Size. ...
1
vote
2answers
520 views

How to create and work with custom data / tables (i.e., for arbitrary data)?

Getting started on Wordpress just today. I noticed that Wordpress created tables in a mySql database (with name *.wrdp1) when I first set it up. These tables cover comments, posts, users, and some ...
-1
votes
1answer
399 views

How do I create a single Wordpress page that will use PHP to include different HTML files based on a vaule in the URL?

I have used PHP on a page to include HTML files on a page such as: <?php require("http://www.mysite.edu/_sports/static/season_box.html"); ?> This works well for including a single file that ...
0
votes
1answer
39 views

Apply html elements in php statement

I know this is probably going to sound like a beginner question ... to which it is in some sort. I have this statement in my one plugin that i am working on: add_post_meta($newpostid, 'name', ...
0
votes
1answer
35 views

select wordpress custom post type

I have one wordpress theme which contain Custom Post Type. And in my theme I can add that as a page which show some different URL. Now when I call a WP function (is_page('some-page')) for wordpress ...
1
vote
0answers
66 views

need help with existing code showing subpages

I am helping a friend make some changes to a wordpress theme. At the moment displaying subpages works only for one parent and its subpages (the one with id 31), but we want it to work for all pages ...
0
votes
1answer
472 views

Custom action on comment post

Whenever a user posts a comment, I'd like to basically have a copy of the post sent to another database for a separate site. The database part is simple, but I can't seem to find the right action hook ...
2
votes
1answer
1k views

Display user's total comment count outside The Loop

How do I display a user's total comment count outside The Loop? I use this code to display comment count inside the loop: <?php global $wpdb; $user_id = $post->post_author; ...
0
votes
2answers
562 views

is_user_logged_in returning nothing on custom page

I am trying to use WordPress authentication on a custom PHP page however when checking "is_user_logged_in" it returns nothing at all and other functions are also returning nothing helpful. The code I ...
1
vote
2answers
203 views

Is there a way of putting the facebook social plugins into page template php files?

I was wondering if there was any way of putting the features that come with the "Facebook" wordpress plugin, such as comments, recommend and subscribe, on my front page which I created using a ...
1
vote
0answers
77 views

register_taxonomy() take much queries

Sorry for my poor English, I'm russian. I have a problem by adding a lot of taxonomies. When I added about 80 taxonomies, I get the following results(without caching): before: 44 queries 0.352 ...
-1
votes
1answer
546 views

Sort author list alphabetically

I have narrowed the code down to this: <?php $authors = $wpdb->get_results('SELECT DISTINCT post_author FROM '.$wpdb->posts); if($authors): foreach($authors as $author): ...
1
vote
2answers
762 views

Can is_page() be combined with a switch control structure?

I'm using an if/else control structure to add class attributes to tags. Could I use a switch control structure instead and if so, how? If not, is there a better way to do this than what I'm doing? ...
0
votes
1answer
73 views

avatar displays outside of targeted area

I use this micro message system script and I want to add an avatar to it, however, my lack of PHP knowledge is making this difficult. The code I use to display an avatar is: ...
0
votes
1answer
412 views

Geocoding an Exploded Custom Field Array

So, I'm having a little problem with crossing signals in WordPress between Google Maps' API and an exploded custom field. I want to be able to geocode an address that's been exploded from a custom ...
-1
votes
1answer
35 views

Specific php document for a page

I'm Doing a site with some content that can be updated by Wordpress, but, It would be a lot times if I could write a php document for one page and other php document for another page, Like ...
1
vote
1answer
2k views

How do I pass a post ID to the page URL?

I am using a form (gravity form) on my site. The form is inserted in a page (called form_page) on the users dashboard when they are logged in http://example.com/dashboard/form_page I am using a ...
1
vote
1answer
6k views

wp_handle_upload - The uploaded file could not be moved to wp-content/uploads/2012/09

This is the code I am using to upload the file to WordPress define(‘WP_DEBUG’, true); $filename = "test.png"; $tmpFile = download_url("http://url.com/testing/crop/".$filename); chmod($tmpFile, ...
0
votes
2answers
91 views

How to get movies by date

Ola, i am building a complex cinema site, and i want to get movies by date Ex: The movies are aded trought post type, I have a custom field name date. How can i retrive the Movie that shoud play ...
0
votes
1answer
603 views

Check if a class exists within a method

I'm new to OOP and I'm writing my first plugin. I want to check if the Facebook plugin has already been activated. If so, I want to skip some code: class MyClass { ... function fb_js_sdk_setup() ...
0
votes
3answers
187 views

How can i display 3 post types in same page?

How can i display 3 post types in same page search results. http://cinema.trancelevel.com/ For example i have post_type1-Movies post_type2-Trailers post_type3-Subtitrari Wen i search i want to ...
-1
votes
2answers
762 views

PHP Call to External Database

I am using the Sleek child theme from Studio Press and want to do a PHP call to this external database for it to display just like this link: http://www.escort332.org/tuskegeecadets.php . The Theme ...
0
votes
1answer
633 views

Issue displaying multiple TinyMCE editors with WPAlchemy

I have a custom post type with a WPAlchemy admin meta box class including multiple textareas with TinyMCE editors(for adding content to the custom post template). I've gotten the editors to display ...
0
votes
1answer
141 views

Query Custom Post Type by Tag

Kinda confused on this.. hoping someone can help. I have custom post type named "Providers" that I want to pull entries from that are tagged "highlighted". I enabled tag support on the custom post ...
1
vote
1answer
2k views

mysql query from wordpress page using custom table

I want to a mysql query that matches a page title. Not sure of a better way to accomplish this task, but I am stuck. This is my basic test code. <?php $page_title = wp_title(''); echo ...
0
votes
1answer
237 views

Adjust the order for returned posts

I have written a neat responsive slider for my Wordpress featured articles (feel free to use it): <?php $responsive = 'on' != get_option('henrik_responsive_layout') ? false : true; ...
-2
votes
1answer
1k views

Use ajax response in PHP function

Ok, so I'm working on a plugin and just ran into a problem. Here's what I'm doing: 1. Using a metabox with Plupload to upload an image to an upload dir in the plugin folder. 2. Upon upload success a ...
1
vote
1answer
87 views

Most liked page not displaying posts

I was looking for a post rating system for a while, then I stumbled across a great tutorial: http://wp.tutsplus.com/tutorials/how-to-create-a-simple-post-rating-system-with-wordpress-and-jquery/ I ...
1
vote
1answer
422 views

Changing the template hierarchy

Is there an easy way to change the WP default template hierarchy? For instance; Say I want to change my theme directory structure so that it completely changes from the Template Hierarchy suggested ...
1
vote
2answers
2k views

Loop through posts of a custom-post-type (event) and create .ics (iCal) file?

I really need your help with a feature I have never worked with so far. I have a custom-post-type named wr_event. And I created this custom WP_Query to retrieve all posts for this post-type that are ...
0
votes
2answers
157 views

Including a PHP file via a function that is part of a plugin?

I struggled with this all day, and now am here... I have a contact form generated by including a php. Presently, I have this code in my theme's index.php to include it: if ( is_page('contact') ) { ...
2
votes
1answer
2k views

wp_customize_image_control default value

I am trying to create a custom theme using Wordpress 3.4's customization options. I would like to create an option to change the theme's logo, but I would like to also display a default logo image. ...
2
votes
2answers
2k views

How to use nonce with front end submission form?

Thanks to a variety of posts on here I've managed to put together a front end submission form. After about 24 hours of tweaking I've finally got everything working including a redirect to a 'success' ...
0
votes
2answers
50 views

<?PHP getting changed into <!--?PHP

When I post a PHP code snippet into a wordpress post it will convert <?PHP into <!--?PHP To avoid this I must replace <?PHP with &lt;?PHP I am asking if there is a setting or easy ...
0
votes
1answer
139 views

Themes with variable width or single columns? I want to display source code

I've just set up a new wordpress blog, and as a developer I want to post some source code as well. Now I found the suitable plug-ins I need, and also a sleek theme, or so I thought. The problem is ...
1
vote
1answer
784 views

How to sanitize uploaded file filename from a plugin?

There is a problem with WordPress Form Manager plugin that doesn't sanitize the uploaded file filename. So, when a user upload a photo with special characters in the filename, you will not be able to ...
0
votes
1answer
731 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 ...