[SOLVED] Error in PHP Coding Using PHP Text Widget
This should be simple but for some reason it is not. I am using Executable PHP widget to place some coding within a right inner sidebar. I created a custom field named "callout_text" that is used to display a sentence or two as a callout of the current post. Within the widget, the code I am placing is:
<?php callout_text(); ?> However, when displaying the page, I get the following error message: Fatal error: Call to undefined function callout_text() in /home/content/r/p/n/rpnimchuk/html/wp/wp-content/plugins/php-code-widget/execphp.php(37) : eval()'d code on line 1 What the heck am I doing wrong? BTW I am using Custom Post Limits to limit the home page to a single post. I am also using WP 2.8.5 and the latest version of Atahualpa. Thanks! Bob Nimchuk |
when you use the syntax 'xxx()' php believes that you are calling the function 'xxx' so somewhere in the code there hast be
HTML Code:
function xxx(parms) { |
Thanks Juggledad. Found the error of my ways. I needed to place the following code in the widget:
<?php global $post; echo get_post_meta($post->ID, "callout_text", true); ?> Because this is contained within a widget you also need to declare the scope (global $post) to return the information. This works great for how I want to display part of blog's content as call out text. Bob |
All times are GMT -6. The time now is 12:36 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.