i am trying to write a little plugin which allows me to add a different theme to each page. well.. still trying.. 😉
The last function is the problem.
When i put return ‘mytesttheme’; at the end it works just perfect!
when i write echo $page_theme.’, ‘; before the return, it outputs: , , , mytesttheme, mytesttheme, mytesttheme, mytesttheme,
in wp-backend it shows “mytesttheme” as post meta content in wp-core post meta content box.. so the saving works as it should..
Any ideas? :S
when i add an ID ($page_theme = get_post_meta(’66’ […]) it works..
1. how do i get the correct ID into my plugin?
2. how can i make some of my function only load in frontend?
thanks a lot
global $wp_query; $postid = $wp_query->post->ID; if ($postid == '') : echo 'NO-ID, '; else : echo get_post_meta($postid, 'page_theme', true) .', '; endif;
NO-ID, NO-ID, NO-ID, NO-ID, NO-ID, NO-ID, NO-ID, cuttlefish, cuttlefish,
I finally made my plugin work.. 🙂
When there is no post-meta i just want to return the current theme folder.
$page_theme = get_current_theme(); returns the whole path.
How do i only get the current theme folders name?
Why not just use
get_stylesheet_directory()and work from there?
Thanks 4 tryin to help, but when i replace line 70 with this:
$url = get_stylesheet_directory();
$page_theme = substr( $url, strrpos($url, ‘/’)+1 );
I get an server error message..
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Any ideas why?
Could someone maybe try this plugin on his/her server? 🙂
writing $page_theme = ‘twenty_ten’; works.. :S
- The topic ‘WordPress Page Theme Plugin’ is closed to new replies.