ellatrix / wp-front-end-editor

Front-end Editor for WordPress
https://wordpress.org/plugins/wp-front-end-editor/
340 stars 87 forks source link

Title prefixed with /> #193

Closed ccurtin closed 9 years ago

ccurtin commented 9 years ago

Not sure if something is botched in my theme somewhere else. Haven't seen anyone else with this problem.

All of my blogposts are prefixed with:

/> 

How I'm currently fixing this is replacing line 408 in class-fee.php

$title .= '<br class="fee-title" />';

with this code instead:


$title .= '<br class="fee-title" />';
ellatrix commented 9 years ago

What's the name of the theme? Can you give me a link?

ccurtin commented 9 years ago

One I created for a client, it's on a local server now. My single.php file was cleanly coded 100%, so possibly somewhere else.

Will report back soon. Thanks

christopheran commented 9 years ago

I'm having a similar issue I think.

In a couple of places I have

get_the_title()

in my theme's code, like this:

'<a href= "mailto:'.$authEmail.'?subject='.get_the_title().'">'.$authEmail.'</a>'

FEE seems to be putting

<br class="fee-title" />

in immediately after the title, so I end up with something like this in my html:

<a href= "mailto:user@gmail.com?subject=Sample Title<br class="fee-title" />">user@gmail.com</a>

which breaks the page a bit.

Maybe I need to use an alternative to: get_the_title() ?

Chris

christopheran commented 9 years ago

Testing... looks like I can use this as an alternative:

single_post_title('',FALSE)

ellatrix commented 9 years ago

You're not using the template tags correctly. If you want to display the title in an attribute, you have to use the_title_attribute().

ellatrix commented 9 years ago

Oh, and if you can't use that, you can do esc_attr( strip_tags( ... ) ). The title, just like the post content, can contain HTML tags, even without this front-end editor.

ellatrix commented 9 years ago

@ccurtin, I can't see the difference between the last two pieces of code you gave.

ccurtin commented 9 years ago

Correct you are! I started off with html5blank for WP but it's.. missing the trailing "_attribute" within the title tag. Easily overlooked!