NakedCat
NakedCat

Reputation: 860

WordPress - empty line inserted before "get_template_part();"

I am working on loading a template part into my theme. The get_template_part(); function works the way it is supposed to be, but it always inserts an empty line before itself.

Here is how it looks in the firebug:

Firebug view

This is how it's coded in php:

Server-side view

This is the content of polecane.php, only one line: This is the content of polecane.php, only one line

What might be the problem? I have to get rid of that empty line because it messes up my layout.

EDIT: This does NOT work: <div class="homepageright"><?php get_template_part('polecane'); ?></div>

Upvotes: 0

Views: 173

Answers (2)

NakedCat
NakedCat

Reputation: 860

I've found the solution. DaveChen's idea with BOM was good, I simply changed the charset for one file only, istead of doing it for both of them. Thank you, now it works.

Answer: Set encoding to UTF-8 without BOM for every file involved.

Upvotes: 2

TunaMaxx
TunaMaxx

Reputation: 1769

Try this:

<div class="homepageright"><?php get_template_part('polecane'); ?></div>

Upvotes: 0

Related Questions