Forum Replies Created

Viewing 8 replies - 16 through 23 (of 23 total)
  • I too would like to find a more elegant solution to this.

    Thread Starter minkowski

    (@minkowski)

    OK, seem to have it but I’d prefer a better solution. I’ve had to insert query_posts(“cat=$selected_categories”); into the search.php with values passed directly to it.

    I would still prefer that this plugin maintained all of the original WordPress functionality though, unless it does and I’m missing something.

    Thread Starter minkowski

    (@minkowski)

    OK, just looking at this this morning I notice that I probably should’ve been a little more ready to check through what was actually happening. I’m not changing the theme, just the stylesheet. I suppose that I do very much need help on how to do that then. (unmarking Resolved, BAH!)

    Thread Starter minkowski

    (@minkowski)

    Well after finishing my tiny plugin, which now fully works, I took a look at that error message and lo and behold, it was whitespace at the end of the file. So, that’s it then. I have a website based on wordpress with multiple sections and themes that automatically apply when looking through those sections. All good.

    Well I say all good, what I mean to say is that I’ve written some of the ugliest code known to man to fudge a few things that I don’t fully understand. Not poetry, not at all, so while I’ll mark this topic as resolved any input into how to get term data from WP when reading a post would be helpful. What I have is a massive SELECT blah FROM blah INNER JOIN blah ON blah = blah WHERE blag after grabbing the post ID from $GLOBALS. If you’re not saying to yourself “that sounds reasonable” then post here and tell me how it could be better!

    ty

    Thread Starter minkowski

    (@minkowski)

    Getting a little ahead of myself there.

    It works but I do have an error that I have no idea how to resolve at this point.

    Warning: Cannot modify header information – headers already sent by (output started at /blah/blah/blah/wp-content/plugins/autotheme.php:127) in /blah/blah/blah/wp-includes/pluggable.php on line 850

    Soooo, no idea what to do now. Any leads?

    Thread Starter minkowski

    (@minkowski)

    OK, think I’ve got it.

    function autotheme_change_theme( $theme = 'default' , $section = 'theunexpected' ) {
    	if (  $section == 'theunexpected' ) {
    		$theme = 'section_one';
    	}
    	return $theme;
    }
    
    add_filter('template', 'autotheme_change_theme');
    add_filter('stylesheet', 'autotheme_change_theme');

    All going well this won’t need too much clearing out of buggy problems. And my goodness, hoorah for WordPress, this sort of stuff is so nicely easy. (once you know how)

    Thread Starter minkowski

    (@minkowski)

    Wow, how stupid do I feel?

    if(dynamic_sidebar('header')) echo "you're quite stupid";

    Pretty stupid.

    Thread Starter minkowski

    (@minkowski)

    OK. There is probably a built in way but this is suiting me until I find it.

    I’ve built the function –

    function widgets_exist($sidebar){
    	$sidebars_widgets = get_option('sidebars_widgets');
    	if (count($sidebars_widgets[$sidebar])){
    		return true;
    	}else{
    		return false;
    	}
    }

    and placed that into the functions.php and calling it in the templates with –

    if (widgets_exist('header')) echo "TRUE";

    As I said, it will do for now but I would have thought that there would be a built in way or a more elegant solution. But in the meantime if this helps anyone else that’s great.

Viewing 8 replies - 16 through 23 (of 23 total)