Redundant code in index.php ?
-
So I messed around a bit with the theme code to try and make it look better. (Frankly, I like the configurability and the basic newspaper idea, but the layout is such a jumbled mess, nothing really lines up well – it could use some work.)
Right in index.php the first lines of code are:
<?php if(get_option($themeoptionsprefix.'_sidebarpos') == 1) {get_sidebar();} if(get_option($themeoptionsprefix.'_sidebarpos') != 2 || get_option($themeoptionsprefix.'_sidebarpos') != 1) {get_sidebar();} ?>
The second statement alone – if it’s not 2 OR if it’s not 1 – well, isn’t that always true, no matter what? What’s the purpose of this here?
And together with statement one, you get something like:
Get sidebar if sidebarpos is 1.
But also if it’s not 1.
Oh, and if it’s not 2.Isn’t that completely redundant?
Thing is I’m not a PHP or WP expert, so I’d like to know whether there is some deeper purpose behind it that I just can’t see, or whether it’s just sloppy code.
- The topic ‘Redundant code in index.php ?’ is closed to new replies.