Questions tagged [php]

For questions about the server-side programming language that the WordPress core, plugins and themes are written in. Questions about using PHP outside a WordPress context are off-topic but might be asked on Stack Overflow.

Filter by
Sorted by
Tagged with
1
vote
2answers
226 views

Using wordpress template tags within an array

A bit of a noob PHP question coming up. I am trying to create a generic archive style view for my custom post types. Ideally I want to create one generic template that can be used for all post-types. ...
2
votes
1answer
899 views

Display All Post Attachments and Assign Class to the Last Image?

I have a function get_images() in which I would like to display all image attachments for the current post (or page) in a list with the last image having a class="last" attribute to mark it as the ...
2
votes
3answers
2k views

I can't view or add comments

Hey, there. I just got this site up and going. http://www.paledogstudios.com It works fine except for the fact I can't seem to see past comments (this blog was imported from blogger) or add comments. ...
3
votes
1answer
4k views

Wordpress multisite causing Error 101 (net::ERR_CONNECTION_RESET): Unknown error [duplicate]

Possible Duplicate: WordPress upgrade now receiving Error 101 (net::ERR_CONNECTION_RESET): Unknown error We have just installed WordPress 3.0.1 and everything worked fine. However, as soon as we ...
2
votes
1answer
2k views

Admin-ajax.php appending a status code to ajax response

I'm writing a plugin that uses Ajax (jQuery with form plugin) via a form submission and the php function returns a JSON response. add_action( 'wp_ajax_bubbly-upload', 'bubbly_upload_submit' ); ...
2
votes
1answer
3k views

Adding graphics to 404.php page

I am trying to customize the 404.php page by adding a graphic. I can figure out how to change the text and links, but the HTML I just don't know well enough to add a picture or graphic. I am using ...
1
vote
1answer
363 views

want to create a subcategory.php to manage subcats

Is it possible to create a subcategory.php and use it to manage subcategories? Or is there a way to get around this? If it is not possible.. is there something like this? <?php if(is_subcategory(...
4
votes
3answers
7k views

How to set custom cookies before output

What's a surefire way to check/set cookies before the php headers are sent? Is there an action or filter that would be the best place to hook a setcookie() function?
1
vote
2answers
7k views

How can I get the page or post language when I use wpml? [closed]

I'm using WordPress MultiLanguage Plugin and I want to know what is the language of a specific element, page or post. I do have the id but I want to obtain the language.
1
vote
2answers
7k views

What might cause “junk after document element” error?

I have PHP errors redirected to log file. Only for WP installation so this definitely doesn't come from somewhere else. This is what started to come up recently (this is all of them, not cut): [22-...
0
votes
2answers
314 views

Best way of getting a a series of custom fields into an array?

I've a series of custom fields attached to certain pages. These fields are named slide1, slide2, side3, slide4, slide5, slide6. These are images which are going to be used as a slideshow (I'm using ...
14
votes
9answers
7k views

Adding first / last CSS classes to menus

is that possible, without javascript hacks? like this: <ul class="my_menu"> <li class="first"> ... </li> <li> ... </li> <li> ... </li> <li class"...
2
votes
1answer
588 views

Widget Javascript code (ajax)

I have a widget like this: class test_widget extends WP_Widget{ function test_widget(){ $widget_ops = array('description' => 'test widget'); $this->WP_Widget(false, 'Test', $...
2
votes
2answers
776 views

WordPress php error after editing file with FileZilla

I use the free FTP software FileZilla. In most cases, whenever I open any PHP file from FTP using FileZilla, I get this error after editing then saving the file: Parse error: syntax error, unexpected ...
3
votes
2answers
596 views

Is This A Correct Example Usage Of current_filter()?

Is this a good example of usage of current_filter()? <?php add_filter("_my_filter", "common_function"); add_filter("_another_filter", "common_function"); function common_function(){ $...
6
votes
3answers
2k views

How to Control user registrations directly on sub-sites

Does anybody have Idea to enable a wordpress based multisite user to automatically get access to all sub-sites under same Multi site ? If I have A Multi-site installation(Also Buddypress enabled) at ...
1
vote
3answers
3k views

I get “The PHP Date/Time library is not supported by your web host.” on my CentOS host, what library to I need to install to add support?

I did some quick looking around, but my PHP skills are pretty nascent. I am sure there is just a package that needs installing. Edit to add additional information about the setup: Using: yum info ...
9
votes
4answers
1k views

WordPress Theme variables scope

I need to create a variable that can be accessed throughout my WordPress Theme template files (index.php, header.php etc..). I know function definitions go inside the functions.php template file (in ...