New update with the possibility to move the button to the top. Nice!
But...
I need a line break after the button. My PHP-skills is not that good.
Anyone that can help?
I am having difficulty with the plugin, when I try to connect it to my Flattr account, I get brought to a page on Flattr which says "Do you allow the application the following access levels to your Flattr account?", but shows no access levels. Upon clicking accept, I get "Something went wrong. Please try again". I have got around this by adding the Flattr Javascript to my wordpress theme until the problem is resolved.
First of all, I apologize if this problem has already been brought up somewhere else--I couldn't find any post related to this.
When looking at the source code of my blog's index page, I noticed that the flattr plugin inserts the excerpt of every blog post into the source, like this:
Code:
<a class="FlattrButton" style="display:none;" href="http://imrich.net/2010/09/wofuer-wien-geld-ausgibt/" title="Wofür Wien Geld ausgibt" rev="flattr;uid:19918;language:de_DE;category:text;tags:Ausgaben,Bäder,Budget,Bürgermeister,Finanzen,Gemeinde,Michael Häupl,Österreich,Politik,Rechnungsabschluss,Wahlen,Wahlkampf,Wien,Wiener Linien;">In einigen Wochen werden in Wien wieder der Gemeinderat und die Bezirksvertretungen gewählt. Neben der latenten Ausländerthematik wird es wohl wieder die eine oder andere Diskussion zur Verwendung des kommunalen Budgets geben.
</a>
</div>
--
link
(My blog uses long excerpts for various reasons--in the above example I truncated the excerpt to about 1/3rd of the actual length.)
I'm concerned that this behaviour of the flattr plugin creates an accessibility problem--people who use a screen reader might see the article stub and then the (rather long) excerpt.
Also, this breaks compatibility with browsers like lynx, possibly other old browsers and for modern browsers with JavaScript and styles deactivated.
Any suggestions on how this could be fixed?
Is there a way to move the button from the left to the right below the posts?
(09-04-2010 06:57 AM)sysadminbloggen Wrote: [ -> ]New update with the possibility to move the button to the top. Nice!
But...
I need a line break after the button. My PHP-skills is not that good.
Anyone that can help?
(11-10-2010 05:30 AM)milkkore Wrote: [ -> ]Is there a way to move the button from the left to the right below the posts?
You should be able to do that with CSS.
sadly there is no class associanted with the button-iframe, so you'll need to wrap around a div and style it.
You need to know a little HTML and WP templates structures for this, though.
I'll try to explain it a little bit. Should work for a standard design:
open up single.php in your templates folder (/wp-content/thems/yourthemename/).
put the following code at wanted the position of the button:
Code:
<div class="flattrbutton"><?php the_flattr_permalink() ?></div>
(note: you'll need to de-activate the automatic button-adding in the backend. otherwise you'll have 2 buttons).
Now we have the button in the article, so we can format it with CSS.
Open up your stylesheet (where it is, depends on your theme).
For extra linebreak/margin bottom:
Code:
.post .flattrbutton {
margin-bottom: 15px //change value, depending on wanted result
}
Right alignment is a little bit more complicated and depends on your style layout. Try following:
Code:
.post .flattrbutton {
width: 110px; //110 for compact, 55px for normal (big) vrsion
float: right;
margin-right: 20px; //change according to needs
}
You can also try position if with position:absolute, but that depends on your layout
I couldn't make it work with float so I just used a lot of margin-left ^^
Thanks, have a flattr for your hassle
If anyone could tell me now where I have to put the...
PHP Code:
<div class="flattrbutton"><?php the_flattr_permalink() ?></div>
...code to make the button appear not only on single post pages but also on the index/archive pages like the button does if you let the plugin autoinsert it, that would be super

Depending on your theme you either have a file called index.php or one called home.php. One of those should be used for the multipost layout.
If you have a seperate archive(s).php file then that will be used for archives.
I've changed the class FlattrButton to the iframe now so you don't need the div around <?php the_flattr_permalink() ?> anymore.
Thing is it will take a few days before this goes live so if you want to have it working right away then this is what you do.
Follow SkaveRats example above only change the css to read:
Code:
.post div.FlattrButton {
width: 110px;
float: right;
}
.post iframe.FlattrButton {
float: right;
}
After a few days the iframe should have a class and you can remove the first of the two css classes.
Hope it helps.
Oh and if you can wait for the update then you wont need to change the templates.. only the css. Ie you can have auto injection of the button enabled.
Tested with the default wordpress theme so mileage may vary.
Thanks heaps, have a flattr too
