Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a little bug on my WordPress...

When I added a custom field, I have no ajax, I need to saved the draft or publish to see the update.

And after I saved my post, the custom field display twice.

name :   Steffi

name :   Steffi

Help, please ! Thanks

Update : Console with Firebug

_ajax_nonce 0
_ajax_nonce-add-meta    53208ba18d
action  add-meta
metakeyinput    
metakeyselect   titre
metavalue   e
post_id 1151
share|improve this question
1  
Can you show us the code you use to display data? –  Steven Dec 15 '10 at 18:41
    
I don't use code. I just add my custom field in my post :) The custom field display twice in the post (admin) –  Steffi Dec 15 '10 at 18:48
    
Custom fields do not "display" just. That needs some code, and that's the part Steven was asking for. By default, custom fields are not displayed at all. –  hakre Feb 6 '11 at 14:51

3 Answers 3

up vote 1 down vote accepted

Hey guys, I found THE solution.

Problems :

  • Custom field display twice.

  • No Ajax/jQuery visual feedback.

If you've been working on the file function.php, make sure you remove extra line breaks.

Particularly at the top and the bottom of your file... If you have some line breaks, your xml got an error : XML or text declaration not at start of entity

share|improve this answer
1  
You can prevent many problems by not putting the ending ?> in your functions.php. Could you accept this answer (by clicking the checkbox) so the system knows you solved it? Thanks, and welcome to the WordPress Stack Exchange! –  Jan Fabry Dec 28 '10 at 18:23
    
Please accept your own answer as "answer" so that this question is marked as solved. –  hakre Feb 6 '11 at 14:52

Try this:

Add this to your config.php file:

define( 'CONCATENATE_SCRIPTS', false );

above the line /* That's all, stop editing! Happy blogging. */

Found here.

share|improve this answer
    
config.php or wp_config.php ? –  Steffi Dec 15 '10 at 19:06
    
config.php doesnt exists, it's wp-config.php –  kevin Dec 15 '10 at 19:09
    
it doesn't work... I don't know why. When I added the custom field: No ajax. And when I refresh, it always displays twice... –  Steffi Dec 15 '10 at 19:13
    
Any error message in the administration? Is it local or online? First time it's doing that? –  kevin Dec 15 '10 at 19:18
    
No error message in the administration. It's online. I think it's doing that since I installed WP-PostViews... (but I can't deleted it, I need it. lol) –  Steffi Dec 15 '10 at 19:21

"Particularly at the top and the bottom of your file... If you have some line breaks, your xml got an error : XML or text declaration not at start of entity"

In addition, you should remove intermediate occurrences of php's closing tag ?>.

For example:

    <?php

  ...code...

    ?> 


 ...Some HTML Code...    

<?php

...code...
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.