theme options

This topic is: not resolved

This topic contains 7 replies, has 2 voices, and was last updated by  gerard 4 years, 1 month ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #3710

    gerard
    Participant

    Hi,

    Thematic Theme 1.0.4
    Child Theme 1.0.4

    Is there a way to prevent appearance> theme options from appearing on a website using the child themes function.php

    Thank You

    Jerry

    #3712

    Scott Nix
    Moderator

    You can remove it from the admin with this -> https://gist.github.com/scottnix/6680736

    The second function included is an override so you can change the default text that still gets output by default from new child themes, or if you don’t use it and enter your own text in the options and then add the filter, it will keep it modified version, but still hide the options.

    #3714

    gerard
    Participant
    Hi, 
    
    Thank you for responding
    
    I did something wrong.
    
    I put the code from the link above - both functions and including <?php, in the bottom of the Responsive Base Child Theme's function.php file and got a fatal error:
    
    Parse error:  syntax error, unexpected '<' in /home3/tpage/public_html/tompkins-county/wp-content/themes/responsive-base-master/functions.php on line 203
    
    I have a copy of the function.php file so can fix it easy.  Did I put the code in the wrong place? 
    
    Thank You,
    
    Jerry
    
    #3715

    gerard
    Participant

    Thank you for responding,

    I did something wrong.

    I put the code from the link above as is- both functions,  in the bottom of the Responsive Base Child Theme’s function.php file and got an error:

    Parse error: syntax error, unexpected ‘<‘ in /home3/tpage/public_html/tompkins-county/wp-content/themes/responsive-base-master/functions.php on line 203

    I have a copy of the file so I can fix it easy.

    Did I put the code in the wrong place?

    Thank you,

    Jerry

    #3716

    gerard
    Participant

    Hi,

    Thank you for your patience

    I tried again

    Below is where I put the code from the link you gave me.  The first function was existing in the responsive base child theme

    Below the code is the error message I got that refers to the override in the existing code?

    <code>

    // just because, wrap the site info in a p tag automatically
    function childtheme_override_siteinfo() {
    echo “\t\t<p>” . do_shortcode( thematic_get_theme_opt( ‘footer_txt’ ) ) . “</p>\n”;
    }

    // removes the theme options page from the WordPress Admin
    function childtheme_thematic_theme_add_opt_page() {
        remove_action( 'admin_menu', 'thematic_opt_add_page' );
    }
    add_filter('thematic_child_init', 'childtheme_thematic_theme_add_opt_page');
    
    // add whatever you want to replace default
    function childtheme_override_siteinfo() {
        echo "Whatever you want";
    }

    </code>

    Fatal error: Cannot redeclare childtheme_override_siteinfo() (previously declared in /home3/tpage/public_html/tioga-county/wp-content/themes/responsive-base-master/functions.php:170) in /home3/tpage/public_html/tioga-county/wp-content/themes/responsive-base-master/functions.php on line 183

    Thank You

    Jerry

    #3717

    Scott Nix
    Moderator

    Don’t include the opening <?php in the code snippet, I just use that so it provides syntax highlighting (I forgot to comment that). 😛

    Also, if you the error you are now getting is caused by having two functions with "childtheme_override_siteinfo()" just delete one or the other, it depends on what you want to do, they are both different, one uses the box in the theme options, the other is a completely custom one, it may be easiest just to use the completely custom one from the snippet.

    TL;DR, Just delete one of the "childtheme_override_siteinfo()" functions. 🙂

    #3718

    gerard
    Participant

    Hi,

    Thank you for your patience

    I removed the existing function that caused the conflict and put both functions from the link in its spot.  In mobile devices, everything that was in appearance > theme options was removed except the login link and below that after a space where everything else would have been was text ‘What ever you want. Its the login link I trying to remove I removed the second function from the link you gave me and the result was the same as when the existing function was there and nothing was added.

    The way my theme options is set up  there is the [loginout-link]  then text-  WordPress  Thematic Theme …. and then there is a shortcode  [member] [/member] and between them are two links – webmail and forum, that appears when a user logs in. Of note, the function for the short code was not put in the responsive base so they are visable with the links when not hidden. I don’t know if this setup is effecting the functions above.

    The last thing I want to do is waste your time- I am using phone emulators.

    Thank you for your patience

    Jerry

    #3742

    gerard
    Participant

    Hi,

    I apologize for not responding sooner.

    The code from the link you gave me work fine.

    Sorry about the confusion.

    Thank you for your help

    Jerry

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘theme options’ is closed to new replies.