Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   Headline on post page displays as "Auto Draft" (http://forum.bytesforall.com/showthread.php?t=7684)

cytaylor Jun 20, 2010 08:12 PM

Headline on post page displays as "Auto Draft"
 
I just downloaded 3.4.9 version and trying to get the headline to render properly on the post page.

The headline renders on the index page, but not on the actual post page. I figured out how to get the kicker to display but underneath it are the words "Auto Draft" then under that the author and date is displayed.

How do I correct this?

juggledad Jun 21, 2010 04:01 AM

first I suggest you use 3.5.1 (http://wordpress.bytesforall.com/?p=920
second search the forums, this has been answered already

johanM Jun 21, 2010 12:06 PM

1 Attachment(s)
I think it has nothing to do with atahualpha theme. I am using ATA 3.5.1 and it continuous created a new 'Auto Draft' to post table every time no matter what I update, save or do not save the page. Turing off post/page option doesn't solve this issue. I think it is related to wordpress 3's new feature auto-draft, I just don't know how to solve it. :confused:

juggledad Jun 21, 2010 02:33 PM

johanM:
Do the posts that this is happening to have any custom fields starting with 'bfa'?

cytaylor Jun 21, 2010 06:45 PM

Sorry, I'm not a developer so your question is difficult to answer. Can you restate in laymen's terms please? :confused:

juggledad Jun 21, 2010 06:50 PM

Go edit one of your posts that exhibits this issue
Look below the area you type the post, you may see an area of custom fields.
If you see the custom fields, do any start with bfa?

johanM Jun 21, 2010 06:51 PM

Nope. I meant there is NO effects on bfa_meta data unless the post/page has been saved AND the title is untouched.

The first post title 'Auto Draft', in fact, is created at the same time whenever a 'new page' created and wp will give a new post id to that empty data, when I change that 'default' title, and click 'update', it changed, but wp 3, created another empty line of 'Auto Draft' in the post table, following every update, it created another one...and so on.

a little research here

wp add to 3.0 on purpose, see http://core.trac.wordpress.org/ticket/11889 :(

Quote:

  1. creates a post with post_status=auto-draft
  2. First auto- or manual save turns it into a real draft
  3. when auto-drafts are created, it deletes ones older than one week
  4. you now always have a post ID on the post edit screen, which fixes all those attachment- and meta-related bugs. No more fetching new nonces. No more negative post IDs.

and http://wordpress.org/support/topic/411355

Quote:

Auto drafts are what is created when you first visit the edit page so as to ensure any action you take on the page gets correctly associated with the post.
Previously there were issues if you tried to upload images before setting any other attributes on a post and thereby creating a draft post.
On save it will become a real draft and after a while the old ones will be deleted.
To skip with save it as 'Auto Draft', you can made a little modification on the ata's function.php to remove that 'Auto Draft', the funny title will be gone as wished, but this data still create on the db table.

Code:

(template_dir/function.php, about line 603)
$title = ($post_id->post_title !== 'Auto Draft') ? $post_id->post_title : '';


lmilesw Jun 22, 2010 11:58 AM

I was getting this same issue on all my WP 3 sites. johanM's solution fixed it.

jessrip Jun 22, 2010 06:28 PM

Quote:

Originally Posted by cytaylor (Post 35045)
Sorry, I'm not a developer so your question is difficult to answer. Can you restate in laymen's terms please? :confused:

Me too - I've read through several posts in the forum but I'm afraid I'm terribly confused. I just want to be able to post to my blog with the actual title again. Also I've uploaded the 3.5.1 version to my host but can't figure out why it's not activating?

Thanks so much for your time and any assistance.

ETA: Finally, figured it out... what worked for me was figuring out how to upgrade to 3.5.1 (if it would have been a bear it would have bit me), and then deleting the custom fields at the end of the offending post that had "bfa". Thank you. :)

cytaylor Jun 22, 2010 11:16 PM

yep.

bfa_ata_body_title

'Auto Draft' is in the 'value' field. So I deleted it and now my headline shows up.

Does that fix the problem indefinitely or will I have to check w/ every post?

Thanks so much!

cytaylor Jun 22, 2010 11:30 PM

"ETA: Finally, figured it out... what worked for me was figuring out how to upgrade to 3.5.1 (if it would have been a bear it would have bit me), and then deleting the custom fields at the end of the offending post that had "bfa". Thank you."

So do tell about activating 3.5.1. I'd like to unzip it too but haven't a clue. :-)

juggledad Jun 23, 2010 07:53 AM

If you are techie and know SSH, you can unzipped it on the host, otherwise unzipped it on your computer then upload the entire folder 'atahualpa351' to the wp-contents/themes folder and it will show up next time you go to dashboard->appearance->themes and you can activate it.

webdevgal Jun 26, 2010 07:09 PM

I found a workaround (that worked for me anyway) for the 'Auto Draft' problem that will get Atahualpa's metaname/values to work under an installation you've upgraded to WordPress 3.0 while using an older version of Atahualpa even if you haven't upgraded to Atahualpa 3.5.1, without disabling the post/page options (which I use a lot), without modifying code (functions.php) and without ripping the bfa_ata* fields out of your database. Yeah, I wanted the best of all worlds.

It's a simple change in how you use the Edit Page interface.

Type in your bfa_ata_* values, click 'Update' under each name. Then _get_out_ of the page dialog before you make any more changes. Next time you come back into the page editing interface, the bfa_ata* field values you last updated are still set. There's just some problem with synching up the Page 'Update' and the Atahualpa metavalue's 'Update', so they need to be done in separate operations. By the way, clicking update under the metaname then continuing to make regular page Updates without exiting the dialog will not work. You need to exit the Page editing interface then come back in.

I verified this behavior by watching my database through PhpMyAdmin as I made each change. As soon as I hit the metavalue's update field, the correct value was updated. But as soon as I hit the main page's Update, it overwrote my bfa_ata* values with 'Auto Draft'. If I exited the whole dialog first then came back in, subsequent Updates to the page content did not erase my last-updated values.

I see this problem only in sites where I updated both WordPress _and_ Atahualpa. I tested with a fresh install of WP 3.0 and Atahualpa 3.5.1 and this is not an issue.

adum Jun 28, 2010 02:33 PM

Quote:

Originally Posted by johanM (Post 35047)
....

To skip with save it as 'Auto Draft', you can made a little modification on the ata's function.php to remove that 'Auto Draft', the funny title will be gone as wished, but this data still create on the db table.

Code:

(template_dir/function.php, about line 603)
$title = ($post_id->post_title !== 'Auto Draft') ? $post_id->post_title : '';


Where do you put the mod exactly? Like before / after which lines? I've edited my functions.php file before and depending on what version of atahualpa you're using, line 603 is probably going to be different.

Thanks in advance for the help!

lmilesw Jun 28, 2010 07:50 PM

In functions.php replace
HTML Code:

$title = $post_id->post_title;
with
HTML Code:

$title = ($post_id->post_title !== 'Auto Draft') ? $post_id->post_title : '';

adum Jun 29, 2010 06:23 AM

Thanks for the help Larry!

juggledad Jul 6, 2010 04:42 AM

added to the 'To Do' list for next release (see http://forum.bytesforall.com/showthread.php?t=7973 post #1)

hollidaysjohn Jul 23, 2010 02:25 AM

I guess this issue is still outstanding?

lmilesw Jul 23, 2010 04:44 AM

Yes it is.

aTart Aug 8, 2010 09:56 AM

thank you, thank you, thank you!!

ole@oleaustin.com Oct 22, 2010 05:21 PM

I'm now using Atahualpa 3.53.
You tell us to replace the first set of code with the second set of code but that second set of code (the one with auto draft in it) is the line that is already in my functions.php file.
So I thought... maybe they got it backwards. So, I replaced the second set of code with the first. No change. Changed it back. No change.
I set my post/page option to both yes and no. No luck.
Then I updated Wordpresss.
I tried the Yes/No option again. No luck.
I also tried simply deleting the words "auto draft" from the code. That didn't work either.
Is there a step I'm missing?
I have All in One SEO. Could that relate somehow?

lmilesw Oct 22, 2010 07:19 PM

Here is the text again and I have added some text to hopefully clarify.

Edit the functions.php (in the Atahualpa theme folder)
At about line 603 replace
$title = $post_id->post_title;
with the following
$title = ($post_id->post_title !== 'Auto Draft') ? $post_id->post_title : '';


The line you are changing is right after
$thePostID = $post->ID;
$post_id = get_post($thePostID);

So currently the three lines that are there look like
$thePostID = $post->ID;
$post_id = get_post($thePostID);
$title = $post_id->post_title;

And what should be there after the change is
$thePostID = $post->ID;
$post_id = get_post($thePostID);
$title = ($post_id->post_title !== 'Auto Draft') ? $post_id->post_title : '';

The changes above will only prevent the Auto Draft from happening in the future and will not remove any Auto Draft entries. To get rid of those you will need to get into your database. If you are not clear on what you are doing though don't do anything. As always do a backup before making any changes.

ole@oleaustin.com Oct 23, 2010 09:58 AM

So enormously helpful! Thank you so much for helping me sort through the final pieces!
I was hoping I wouldn't have to delete and recreate all the pages I've created in the last week but I did and all in all I'm now VERY happy to have the problem solved (and to have been able to do it myself). Have a great weekend!

joe hark Nov 2, 2010 04:40 AM

Me too!

Excellent problem solving.

A(nother) donation will be forthcoming tomorrow.

athriftymom Jan 21, 2011 01:44 PM

Quote:

Originally Posted by johanM (Post 35047)
Nope. I meant there is NO effects on bfa_meta data unless the post/page has been saved AND the title is untouched.

The first post title 'Auto Draft', in fact, is created at the same time whenever a 'new page' created and wp will give a new post id to that empty data, when I change that 'default' title, and click 'update', it changed, but wp 3, created another empty line of 'Auto Draft' in the post table, following every update, it created another one...and so on.

a little research here

wp add to 3.0 on purpose, see http://core.trac.wordpress.org/ticket/11889 :(

and http://wordpress.org/support/topic/411355

To skip with save it as 'Auto Draft', you can made a little modification on the ata's function.php to remove that 'Auto Draft', the funny title will be gone as wished, but this data still create on the db table.

Code:

(template_dir/function.php, about line 603)
$title = ($post_id->post_title !== 'Auto Draft') ? $post_id->post_title : '';


Ok so I tried to find that code and its not there. My functions.php only has like 450 lines.. and in the title area there is no word Auto Draft..
any idea of what to do?

also I tried to update manually and it spit out tones of errors on my site and my site went down.. so for now i'm sticking with:

Atahualpa 3.4.1

lmilesw Jan 21, 2011 01:52 PM

You wouldn't see the words Auto Draft in the functions.php. The code shown is what that line needs to be changed to. I would also suggest making a copy of the functions.php file in case the edit messes something up.

Also what do you mean you got tons of errors when you manually upgraded? How did you do the manual upgrade?

rgreeniwa Apr 6, 2011 01:20 PM

I just upgraded to AT 3.6.4 and now have the Auto Draft problem also. Am using WP 3.1.1.

Did this happen to anyone else?

lmilesw Apr 6, 2011 01:53 PM

How did you do the upgrade? What version of Atahualpa did you upgrade from?

rgreeniwa Apr 6, 2011 03:29 PM

I just used the automatic upgrade as I always do.

Based on suggestions in this thread, I went into functions.php and noted that

$title = $post_id->post_title;

was commented out with a #, so I removed the # and put a # in front of the next line:

$title = ($post_id->post_title !== 'Auto Draft') ? $post_id->post_title : '';

That seems to work on new posts.

So for now I guess I'm OK until the next upgrade.

Don't know why the default functions.php file would have this.

Now, I'm having other errors like Wordpress SEO not being able to activate. It's getting a parse error. But this probably isn't related to Atahualpa, though I guess it could be.

lmilesw Apr 6, 2011 03:56 PM

That comment is supposed to be on the line it was on to prevent the auto draft from occurring. The line with Auto Draft should not be commented. I am not sure why this "worked" for you but I suspect it was a fluke and that something else is going on.

rgreeniwa Apr 6, 2011 04:25 PM

Larry --

Dunno. I'm not a programmer. It just looked like the right thing to try & it did seem to work. I deleted the afflicted post and recreated it, and the title is now displaying correctly.

Why would anyone want a title of "Auto Draft" anyway? So I wonder why there's even any mention of it in the code?

As I mentioned, I am also having some parse errors in two SEO plugins, Wordpress SEO and LJ Longtail SEO, which worked fine previously.

Quite honestly, I don't know if the AT theme upgrade or the WP 3.1.1 upgrade broke these, as I had done both before I noticed any issues.

I even deleted Wordpress SEO & reinstalled it to make sure there wan't a corruption going on.

Any other suggestions?

rgreeniwa Apr 6, 2011 04:27 PM

I've got several WP sites and you can bet I'm not upgrading those anytime soon!

R_

lmilesw Apr 6, 2011 10:16 PM

WordPress implemented the Auto Draft creation for various reasons. It has something do do with how posts are saved. One of the later versions of Atahualpa added the line you commented out to prevent the creation of the Auto Draft Title. Some plugins may affect this as well.

I am not sure why you are running into this but you could try deactivating plugins to see if any of them are the culprit if you like.

eric41 Apr 17, 2011 06:30 AM

Hey all, just dropping in on this with news of a little plugin that worked great for me and may be helpful for some of you who are having the "Auto Draft" problem replacing your page titles. This plugin was also very helpful because it deals with pesky custom fields in existing posts/pages as well. Hope this helps some of you!


All times are GMT -6. The time now is 03:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.