splorp / tersus

An achingly simple WordPress theme without all the usual cruft.
GNU General Public License v3.0
99 stars 6 forks source link

"Undefined variable: post_id…" in functions.php #47

Closed grettir closed 11 years ago

grettir commented 11 years ago

When debug mode is enabled in WordPress, the Tersus customization screen generates the following notice in the preview iframe (on the right):

Notice: Undefined variable: post_id in /xxxxxxxx/wp-content/themes/tersus/functions.php on line 218
class="hentry" id="post-1">

I think the solution is to use the global $post variable by changing line 218 from:

    $post = get_post($post_id);

...to:

    global $post;
splorp commented 11 years ago

Hrm. I don’t see this particular message, but I am still running WordPress 3.4.2.

Most of the debug messages I’m seeing are related to the deprecation of theme functions, and have already been documented in issue #37.

Notice: get_theme_data is deprecated since version 3.4! Use wp_get_theme() instead.
     in /home1/newtedor/public_html/splorp/wp/wp-includes/functions.php on line 2638
Notice: get_settings is deprecated since version 2.1! Use get_option() instead.
     in /home1/newtedor/public_html/splorp/wp/wp-includes/functions.php on line 2638
splorp commented 11 years ago

I found two additional ‘Undefined variable” issues affecting searchform.php … both have been fixed — along with the aforementioned error — per commit: f0af6bff33c14873ff7b0705e5a018ffed618dde