Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Warning: Cannot modify header information - headers already sent by (output started at /home/themes/public_html/forums/bb-includes/db-mysql.php:12) in /home/themes/public_html/forums/my-templates/kakumei-variant/rss2.php on line 1
ThemeShaper Forums Topic: Invalid Argument Warning http://forums.themeshaper.com/ Help In Shaping WordPress Themes en Sat, 30 May 2015 16:29:41 +0000 em hr on "Invalid Argument Warning" http://forums.themeshaper.com/topic/invalid-argument-warning#post-27722 Sat, 15 Dec 2012 16:53:24 +0000 em hr 27722@http://forums.themeshaper.com/ <p>This is likely because the global variable $options is no longer used in Thematic. </p> <p>Current versions of thematic handle this code using the helper function thematic_get_theme_opt() </p> erikas_boy on "Invalid Argument Warning" http://forums.themeshaper.com/topic/invalid-argument-warning#post-27468 Mon, 09 Jul 2012 20:25:18 +0000 erikas_boy 27468@http://forums.themeshaper.com/ <p>Hello,<br /> So, here's what I was trying, I'll get to the error in a moment. I want my blog to only show the two most recent posts on the front page, but show 10 posts on every other page (/2/, category archive, tag archive, search, etc). So I set show posts in the backend to 10, then grabbed this from content-extensions.php</p> <p><code><br /> global $options, $blog_id;</p> <p> foreach ($options as $value) {<br /> if (get_option( $value['id'] ) === FALSE) {<br /> $$value['id'] = $value['std'];<br /> } else {<br /> if (THEMATIC_MB)<br /> {<br /> $$value['id'] = get_option($blog_id, $value['id'] );<br /> }<br /> else<br /> {<br /> $$value['id'] = get_option( $value['id'] );<br /> }<br /> }<br /> }</p> <p> /* Count the number of posts so we can insert a widgetized area */ $count = 1;<br /> while ( have_posts() ) : the_post();</p> <p> thematic_abovepost(); ?&gt;</p> <p> &lt;div id="post-&lt;?php the_ID();<br /> echo '" ';<br /> if (!(THEMATIC_COMPATIBLE_POST_CLASS)) {<br /> post_class();<br /> echo '&gt;';<br /> } else {<br /> echo 'class="';<br /> thematic_post_class();<br /> echo '"&gt;';<br /> }<br /> thematic_postheader(); ?&gt;<br /> &lt;div class="entry-content"&gt;<br /> &lt;?php thematic_content(); ?&gt;</p> <p> &lt;?php wp_link_pages('before=&lt;div class="page-link"&gt;' .__('Pages:', 'thematic') . '&#38;after=&lt;/div&gt;') ?&gt;<br /> &lt;/div&gt;&lt;!-- .entry-content --&gt;<br /> &lt;?php thematic_postfooter(); ?&gt;<br /> &lt;/div&gt;&lt;!-- #post --&gt;</p> <p> &lt;?php </p> <p> thematic_belowpost();</p> <p> comments_template();</p> <p> if ($count==$thm_insert_position) {<br /> get_sidebar('index-insert');<br /> }<br /> $count = $count + 1;<br /> endwhile;<br /> }<br /> }<br /> </code></p> <p>Then edited<br /> <code>while ( have_posts() ) : the_post();</code><br /> to<br /> <code>while ( have_posts() &#38;&#38; $count&lt;3 ) : the_post();</code></p> <p>This did what I wanted, 2 on the index, and 10 everywhere else. Except it started throwing an error. Specifically: Warning: Invalid argument supplied for foreach() in /home/content/17/4755417/html/beer/wp-content/themes/TBB/functions.php on line 399, which is the line<br /> <code><br /> foreach ($options as $value) {<br /> </code></p> <p>It continues to throw the error when I remove my edited line. It seems to be a problem with the array, but darned if I can figure out what it is. I (obviously) copied and pasted the code from the content-extensions.php file into my functions.php in my child theme.</p> <p>So, am I missing something really obvious? Including a much easier way to do what I want, which I would have expected to find via google/searching here.</p> <p>Thanks in advance. </p>