If you are editing the theme template files directly, I would highly recommend creating a child theme — especially when editing a default WordPress theme like Twenty Eleven. Otherwise, when you update to the next version of WordPress, all of your changes will be lost.
That said, the blog template is typically controlled by index.php (or home.php if it exists), and the single posts are handled by single.php. See WordPress Template Hierarchy for more info.
Twenty Eleven also supports Post Formats, so all of the code that occurs inside The Loop is located in content.php or content-{type}.php.
Thread Starter
Anthyx
(@anthyx)
Hi Shaun, and tnx for the advices, I’ll try to explain better my problem:
In my twenty eleven child theme I’ve placed a couple of buttons, needed to polylang multi-language plug-in, just under the menu bar, on the right.
In style.css I’ve added this code:
.lang-switch {float:right;}
.lang-item {display: inline; list-style: none;}
At the very bottom of the header php I’ve inserted this code:
<ul class=”lang-switch”><?php
pll_the_languages(array(‘show_flags’=>1,’show_names’=>0));
?>
Everything works fine in static pages.
In “posts” page (both the “main”, the one with the posts in chronological order and the single post), the title is at the same distance from the menu bar as the language buttons, the buttons appear as usual but .. don’t work at all!
To place the posts content “after” the buttons, so they can work, how could I do? Should I work on index.php, home.php or content.php?
Please help!!!
Many thanks in advance!
A.
Thread Starter
Anthyx
(@anthyx)
If this can help: if I change in style.css file the setting:
.lang-switch {float:right;}
to
.lang-switch {float:left;}
I get the buttons under the menu bar, on the left, working correctly, and the blog text starts just after the right button.
There must be some kind of conflict between “layers” (sorry but I’m ney to wp and php).
The answer would probably be to have those language buttons really “floating”, this way there are no conglich with the posts text.
Hope with this I can add something.
Thanks again.
A.
Thread Starter
Anthyx
(@anthyx)
I did it!
in Header.php I’ve just moved this code:
<ul class=”lang-switch”><?php
pll_the_languages(array(‘show_flags’=>1,’show_names’=>0));
?>
BEFORE the last part of the .php code:
<div id=”main”>
… it work perfectly!
Tnx a lot!
A.