Using PHP Code in a themes options page
-
Hi all,
I′m currently working on an update for one of my themes and I want to add a functionality to the themes options page to edit a tabbed interface.Basically it works perfect. You can define a tab title and a tab content. The tab content works fine as lon as you use regular text and even HTML formating. But I want to enable also PHP for example to put a list of recent posts inside such a tab.
The output of the option in the theme works basically like this:
echo prinz_get_option(‘prinz_tab2_content’);
But this “kills” the PHP tags. The sourcecode looks like that:
<div style=”” class=”ui-tabs-panel” id=”fragment-2″>
<h3 class=”title”>Recent Posts</h3>
<p>To show the recent posts is just one thing you can use this tabbed section
for. There are many more. It′s up to your creativity.</p>-
<!–?php wp_get_archives(‘type=postbypost&limit=7’); ?–>
<!– END TAB 2 –>
</div>You can see the PHP tags are placed in HTML comments and I have no clue why.
Does anyone have an idea how to get PHP code working here?
Thanks in advance
Michael
- The topic ‘Using PHP Code in a themes options page’ is closed to new replies.