Skip to main content

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
2 votes
1 answer
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 ...
Marc's user avatar
  • 21
1 vote
1 answer
365 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(...
andrewk's user avatar
  • 171
5 votes
3 answers
9k 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?
Dan Gayle's user avatar
  • 6,136
2 votes
2 answers
11k 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.
sorin's user avatar
  • 1,123
1 vote
2 answers
9k 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-...
Rarst's user avatar
  • 99.8k
0 votes
2 answers
322 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 ...
cannyboy's user avatar
  • 1,033
15 votes
9 answers
9k 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"...
Alex's user avatar
  • 1,081
2 votes
1 answer
737 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', $...
Alex's user avatar
  • 1,081
2 votes
2 answers
860 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 ...
Jitendra Vyas's user avatar
2 votes
2 answers
1k 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(){ $...
rsman's user avatar
  • 2,300
6 votes
3 answers
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 ...
Name-AK's user avatar
  • 199
1 vote
3 answers
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 ...
Larry Smithmier's user avatar
9 votes
4 answers
2k 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 ...
user avatar

1
208 209 210 211
212