ThemeShaper Forums » Thematic

[closed]

Theme options - footer

(14 posts)
  • Started 1 year ago by Jagst3r15
  • Latest reply from helgatheviking
  • This topic is not resolved
  1. This is for Kathy probably - I am updating Devin's thematic options (he updated them to work with the plugin now if you didn't know), but I am getting them ready for thematic 1.0. You already helped me with removing the panel with this

    function childtheme_remove_theme_options(){
    	remove_action( 'admin_menu', 'thematic_opt_add_page' );
    }
    add_action('init','childtheme_remove_theme_options');

    but now I am trying to get the footer to work. I have tried for a couple hours looking at the theme-options in thematic 1.0 but cannot figure out how to get the footer option to work properly (yes that is sad lol). Here is the code for reference:

    function thematicoptions_footer($thm_footertext) {
    	$footertext = of_get_option('footer_text');
        return $footertext;
    }
    
    add_filter('thematic_footertext', 'thematicoptions_footer');

    I tried really hard to figure this out, but alas php has got me again - any idea what to change?

    BTW: I'm going to send devin a pull request on these options and will tell him you helped me update them. We should add a link on thematictheme.com to the options too - they are a good starting point for people :)

    Posted 1 year ago #
  2. are you sure that your of_get_option is returning anything?

    you could also try :

    function childtheme_override_siteinfo(){
      echo of_get_option('footer_text');
    }
    Posted 1 year ago #
  3. thanks, worked like a charm.

    Edit: the only problem is the shortcodes don't work this way

    Posted 1 year ago #
  4. well copying from footer-extensions.php, try adding:

    function childtheme_override_siteinfo(){
      echo do_shortcode(_(stripslashes(of_get_option('footer_text')));
    }
    Posted 1 year ago #
  5. Hi,

    Note that init is not the best action hook for removing the theme options. By hooking into init you're trying to remove the action on every page load on the front end as well. Since you only need to remove the action on the admin pages admin_menu is the best hook to use.

    Try this in the future:

    function childtheme_remove_theme_options(){
    	remove_action( 'admin_menu', 'thematic_opt_add_page' );
    }
    
    add_action('admin_menu','childtheme_remove_theme_options', 9);

    A priority of less than 10 is needed to make it queue properly.

    Posted 1 year ago #
  6. Thanks gene I never knew that ;). This

    function childtheme_override_siteinfo(){
      echo do_shortcode(_(stripslashes(of_get_option('footer_text')));
    }

    did not work. It says I am getting a syntax error with an unexpected ";" . Sorry for asking so many questions - I know you help for free and that I am a total php noob :).

    Posted 1 year ago #
  7. unpexpected whatevers are just syntax errors... it just means i have a typo or forgot something that should come before the ;

    looks like there are 4 opening parens ( and only 3 ) closing parens.

    still no guarantee b/c i haven't tested it

    function childtheme_override_siteinfo(){
      echo do_shortcode(_(stripslashes(of_get_option('footer_text'))));
    }
    Posted 1 year ago #
  8. thanks a bunch, although that was dumb on my part for not looking at the parentheses! *smacks forehead*

    BTW: Do we even need these anymore?

    define('THEMATIC_COMPATIBLE_BODY_CLASS', true);
    define('THEMATIC_COMPATIBLE_POST_CLASS', true);
    define('THEMATIC_COMPATIBLE_COMMENT_HANDLING', true);
    define('THEMATIC_COMPATIBLE_COMMENT_FORM', true);
    define('THEMATIC_COMPATIBLE_FEEDLINKS', true);
    Posted 1 year ago #
  9. we won't be. i'm pretty sure we did away with constants in the 1.0 release. if you want the legacy classes i think you'll have to use add_theme_support. someone should drum up a tutorial on that... maybe when it gets approved through theme review.

    less sure about comment handling and comment form.

    Posted 1 year ago #
  10. we won't be. i'm pretty sure we did away with constants in the 1.0 release. if you want the legacy classes i think you'll have to use add_theme_support. someone should drum up a tutorial on that... maybe when it gets approved through theme review.

    less sure about comment handling and comment form.

    Posted 1 year ago #
  11. bogh
    Member

    I was wondering if in the OP we can make the shortcodes to be supported in all textareas, not just in the one for the footer.
    What do you think, how this can be done?

    Posted 1 year ago #
  12. Most of them work in all areas already.

    Posted 1 year ago #
  13. bogh
    Member

    Actually I am using the old OP v2.2. And I think here you are talking about the latest version. Now I am updating it for Thematic 1.0.

    My problem with shorcodes is that I have to add do_shortcode() on every option I want to use them, so I was thinking that would've been better if the textarea would support shortcodes by default. But maybe this one was already included in the latest version, I haven't tested.

    Posted 1 year ago #
  14. i disagree that textareas should support shortcodes by default. imo, textareas shouldn't support anything by default... and leave the ability to add any type of filter to the saved option.

    you could

    echo apply_filters('the_content', of_get_option('footer_text'));

    which will recreate all the filters that are attached to the_content, such as wpautop (auto paragraphs) etc. or for only the shortcode filter you could

    echo apply_filters('options_content', of_get_option('footer_text'));

    and somewhere else in functions.php

    add_filter('options_content','do_shortcode');
    Posted 1 year ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.