WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] *get_theme_mod* seems not returning any value after upgrading tp WordPress 3.1 (14 posts)

  1. rguan
    Member
    Posted 3 years ago #

    Hi there,

    My theme got a serious problem when upgrading to WP 3.1, it seems that *get_theme_mod* does not return any value.

    Theme could be download at: http://bit.ly/gWNPVd

    I set the get_theme_mod value via Theme Options in functions.php:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    The theme / above code is working properly when using WP 2.8 - 3.0.5, but not working in 3.1, it's very urgent, any one could help?

    Thanks,
    Roy

  2. rguan
    Member
    Posted 3 years ago #

    Any one have similar problem?

  3. snosites
    Member
    Posted 3 years ago #

    I'm having the exact same problem. My options page code is the same as above, and it quit working with the upgrade to 3.1. It has worked fine in all previous versions of WordPress. Does anyone know what changed in WordPress that is causing this problem?

  4. rguan
    Member
    Posted 3 years ago #

    Fixed the issue:

    change:

    'mods_'.get_current_theme();

    to:

    'theme_mods_'.get_current_theme();

  5. snosites
    Member
    Posted 3 years ago #

    That fixed it for me. Thanks, rguan!

  6. Glance World
    Member
    Posted 3 years ago #

    I have the same problem with my theme. if have do the same thing which you have suggest by rguan but unable to save and retrieve values. Please help me out its very urgent.

    Here is my code which i am using.

    http://wordpress.pastebin.com/LULHQ1Bm

  7. rguan
    Member
    Posted 3 years ago #

    You should change the theme folder name to the same as the theme name.

    Could you let me know your site URL and which you are using so that I can check for you?

  8. snosites
    Member
    Posted 3 years ago #

    You can also change 'theme_mods_'.get_current_theme();

    to 'theme_mods_themename';

    Use the actual name of your theme, and make it lowercase.

  9. hznmoodi
    Member
    Posted 3 years ago #

    Changed "$settings = ‘mods_’.get_current_theme();"

    To ” $settings = ‘theme_mods_’.get_current_theme();

    its still not working for me… Can’t save the settings. Reset is also not working. its showing the previous settings stored in the DB

  10. snosites
    Member
    Posted 3 years ago #

    hznmoodi,

    What's the name of your theme, and what's the name of the folder that your theme is in?

  11. hznmoodi
    Member
    Posted 3 years ago #

    The Theme Name & Theme Folder is same, I figured out there are two problems:
    1- Save setting Button is not working
    if(isset($_REQUEST['updated']) == 'true'){}
    this is not working

    2- Register Settings is not working when I use array
    register_setting('my_settings', $settings);
    where $settings is an array.. But if I use a single variable it works then. =(

    Thanks in advance =)

  12. Alonce Vincent
    Member
    Posted 3 years ago #

    Use
    $_REQUEST['settings-updated']
    instead of
    $_REQUEST['updated']

  13. webgrafia
    Member
    Posted 3 years ago #

    Same problem to me

    fixed in this way:
    1: change:
    'mods_'.get_current_theme();
    to:
    'theme_mods_'.get_current_theme();

    2: Changed Theme Name to be the same of Theme Folder

  14. Julian Magnone
    Member
    Posted 2 years ago #

    Changing to 'theme_mods_' worked for me, too. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic