Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

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.


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Apr 14, 2011, 01:26 PM
Marco.s
 
10 posts · Feb 2011
[SOLVED] Weird behaviour from Custom read more.

Hi,
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 04:15 PM.
  #2  
Old Apr 14, 2011, 05:27 PM
Marco.s
 
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.

Solved
  #3  
Old Apr 14, 2011, 06:21 PM
juggledad's Avatar
juggledad
 
22,267 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
If you look at teh 'Exec-PHP' settings in the backend there is an option
Quote:
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

Bookmarks

Tags
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 10:06 PM
Custom Read More with PHP adum Excerpts, Read more, Pagination 14 Sep 20, 2010 06:25 AM
Don't show "Custom Read More" for manually created excerpts? adum Excerpts, Read more, Pagination 4 Sep 13, 2010 09:50 PM
[SOLVED] custom read more with manual excerpts byronyasgur Excerpts, Read more, Pagination 2 May 6, 2010 05:27 PM
'Read More' not displaying on custom category-posts-in-a-page maija Excerpts, Read more, Pagination 2 Mar 8, 2010 04:29 PM


All times are GMT -6. The time now is 11:55 AM.


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