Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Excerpts, Read more, Pagination »

[SOLVED] Weird behaviour from Custom read more.

Old Apr 14, 2011, 02:26 PM
10 posts · Feb 2011
found a really weird issue related to the custom read more content and User roles.

Site is bilingual using qTranslate and I needed 2 separated "continue reading" lines...
Using the exec-php plugin (and thanks to another post in this forum section) I was able to set this:
PHP Code:
<?php if ( function_exists('qtrans_getLanguage') && qtrans_getLanguage()=="it") { ?>
<p>Leggi il resto di <a href="%permalink%"> %title% </a> per <a href="%permalink%#Altre%20Foto" rel="nofollow">altre foto</a> e <a href="%permalink%#Pedigree" rel="nofollow">Pedigree</a></p>
<?php } else { ?>
<p>Continue reading <a href="%permalink%"> %title% </a> for <a href="%permalink%#More%20Photos" rel="nofollow">more photos</a> and <a href="%permalink%#Pedigree" rel="nofollow">Pedigree</a></p>
<?php ?>
The code seemed to work randomly: some posts had the proper line, others showed both without any apparent logic.

Finally I realized the only posts showing the proper line where the ones written by administrative roles, while the other user's , with editor role, didn't execute the php IF.

I'm not sure if this is an issue related to Atahualpa or exec-php .
Anyway, since I can't assign the admin role to my editor (she's quite unexperienced and might f*** up the whole site in no time), is there an alternative, hardcoded way to add my custom read more?

Gave it a quick look, and seems bfa_post_parts.php is the file to work on.
Where should I insert the code, in that case? would shortcodes work?

edit: well, either hardcode my IF statement in the bfa_post_parts.php or place it in post_footer_multi so that it could execute php...

Last edited by Marco.s; Apr 14, 2011 at 05:15 PM.
Old Apr 14, 2011, 06:27 PM
10 posts · Feb 2011
well, fixed the issue with a workaround and without messing with atahualpa code:
used Capability Manager plugin, added the proper flag to the editor role and now Editors can execute php aswell.

I guess that when executing the PHP code I used as "Custom read more", exec-php first looks in the user roles and checks it against the post authors. So even if it was the Admin who added the code in ATO, it is executed in the loop, and according to the post author role.

Old Apr 14, 2011, 07:21 PM
juggledad's Avatar
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
If you look at teh 'Exec-PHP' settings in the backend there is an option
Executing PHP code in text widgets is not restricted to any user. By default users who can modify text widgets will also be able to execute PHP code in text widgets. Unselect this option to generally turn off execution of PHP code in text widgets.
you can set that option on and it should work for all users.

Glad you got it solved
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support


custom read more, exec-php, qtranslate

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird Header Image Behaviour micaela Header configuration & styling 2 Feb 14, 2011 11:06 PM
Custom Read More with PHP adum Excerpts, Read more, Pagination 14 Sep 20, 2010 07:25 AM
Don't show "Custom Read More" for manually created excerpts? adum Excerpts, Read more, Pagination 4 Sep 13, 2010 10:50 PM
[SOLVED] custom read more with manual excerpts byronyasgur Excerpts, Read more, Pagination 2 May 6, 2010 06:27 PM
'Read More' not displaying on custom category-posts-in-a-page maija Excerpts, Read more, Pagination 2 Mar 8, 2010 05:29 PM

All times are GMT -6. The time now is 06:32 PM.

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