Error after upgrading

This support request was posted in BBQ by JessBlender

Request ID #37518 Resolved
  • 1. After updating php and the theme and all plugins, I have this error on the homepage: Warning: Invalid argument supplied for foreach() in /home/content/74/10450974/html/wp-content/themes/bbq/includes/theming/typography.php on line 132

    I unclicked the custom font option in the theme options and that removed the error, but I can’t use the custom fonts now. I found a support topic that suggested replacing the theme with a downloaded version via FTP and I tried that too. Didn’t work.

    2. Also, now I can’t delete some food items. http://dadspub.com/menu/ I had images in as a food item – they are black boxes now and I want to delete them, but none of my changes are saving. They are on the second page of the food items on the dashboard listed as notitle.

    Juanfra Aldasoro

    Hi,

    Thank you for writing. I hope you are doing well.

    Did you use the one-click update? What I’d recommend you is to make a backup of your /wp-content/themes/bbq/ folder, download the theme zip, delete the files that you currently have in your site and then upload the new files you get from the zip.

    Best,
    Juan.

    Hi Juan,
    I tried what you suggested and nothing has changed. I still get the error message when turning on the custom typography and I can’t delete some food items.
    Please advise.

    Juanfra Aldasoro

    Hi Jess,

    Thank you for the follow-up.

    Did you delete all the files from your /wp-content/themes/bbq/ folder before uploading the new ones?

    Best,
    Juan.

    Hi,
    Yes. I emptied the folder then replaced it with a fresh download. I tried it twice with no avail.
    Thanks,
    Jess

    Juanfra Aldasoro

    Hi Jess,

    Thank you for the follow-up.

    Would you please try replacing the file /bbq/includes/theming/typography.php with this new one:

    <?php
    /**
    * Bossa by NiceThemes.
    *
    * This file contains functions to manage the different typography options.
    *
    * @see nice_custom_fonts()
    * @see nice_load_web_fonts()
    * @see nice_default_fonts()
    *
    * @package Bossa
    * @author NiceThemes <hello@nicethemes.com>
    * @license GPL-2.0+
    * @link http://nicethemes.com/theme/bossa
    * @copyright 2016 NiceThemes
    * @since 1.0.0
    */
    // If this file is called directly, abort.
    if ( ! defined( 'WPINC' ) ) {
    die;
    }
    if ( ! function_exists( 'nice_custom_fonts' ) ) :
    add_action( 'wp_enqueue_scripts', 'nice_custom_fonts', 20 );
    /**
    * Add custom fonts.
    *
    * @since 1.0.0
    */
    function nice_custom_fonts() {
    global $nice_options;
    // Initialize HTML output.
    $output = '';
    wp_enqueue_style( 'nice-options-styles', get_template_directory_uri() . '/includes/assets/css/nice-options.css' );
    if ( isset( $nice_options['nice_custom_typography'] ) && ( nice_bool( $nice_options['nice_custom_typography'] ) ) ) {
    if ( isset( $nice_options['nice_font_body'] ) && $nice_options['nice_font_body'] )
    $output .= 'body { ' . nice_custom_font_css( $nice_options['nice_font_body'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_nav'] ) && $nice_options['nice_font_nav'] )
    $output .= '#navigation .nav li a { ' . nice_custom_font_css( $nice_options['nice_font_nav'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_subnav'] ) && $nice_options['nice_font_subnav'] )
    $output .= '#top #navigation .nav li ul li a { ' . nice_custom_font_css( $nice_options['nice_font_subnav'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_headings'] ) && $nice_options['nice_font_headings'] )
    $output .= 'h1, h2, h3, h4, h5, h6, .entry h1, .post .entry h2, .entry h3, .entry h4, .entry h5, .entry h6, #post-author h4 { ' . nice_custom_font_css( $nice_options['nice_font_headings'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_buttons'] ) && $nice_options['nice_font_buttons'] )
    $output .= 'input[type="submit"], button, #commentform .button, #respond input[type="submit"], .nice-contact-form input[type="submit"] { ' . nice_custom_font_css( $nice_options['nice_font_buttons'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_inputs'] ) && $nice_options['nice_font_inputs'] )
    $output .= 'input, textarea { ' . nice_custom_font_css( $nice_options['nice_font_inputs'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_primary'] ) && $nice_options['nice_font_primary'] )
    $output .= '.entry .testimonial blockquote, #tabs ul.niceTabs li a, #tabs .inside li a { ' . nice_custom_font_css( $nice_options['nice_font_primary'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_secondary'] ) && $nice_options['nice_font_secondary'] )
    $output .= '#footer .testimonials .feedback blockquote, #footer .testimonials .feedback, #tabs .inside li span.meta, #comments .comment-head .date, #comments .comment-head .edit, #comments .comment-head .perma, #comments .reply, #comments .comment-entry p, #post-author { ' . nice_custom_font_css( $nice_options['nice_font_secondary'] ) . ' }' . "\n";
    // from now onwards
    if ( isset( $nice_options['nice_font_post_title'] ) && $nice_options['nice_font_post_title'] )
    $output .= '.post h2 { ' . nice_custom_font_css( $nice_options['nice_font_post_title'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_post_meta'] ) && $nice_options['nice_font_post_meta'] )
    $output .= '.post-meta { ' . nice_custom_font_css( $nice_options['nice_font_post_meta'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_post_entry'] ) && $nice_options['nice_font_post_entry'] )
    $output .= '.entry, .post-content { ' . nice_custom_font_css( $nice_options['nice_font_post_entry'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_infobox_title'] ) && $nice_options['nice_font_infobox_title'] )
    $output .= '.infobox .entry-title { ' . nice_custom_font_css( $nice_options['nice_font_infobox_title'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_infobox_content'] ) && $nice_options['nice_font_infobox_content'] )
    $output .= '.infobox .entry-excerpt, .menu-box li .description, .menu-box p, .menu-card p { ' . nice_custom_font_css( $nice_options['nice_font_infobox_content'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_slider_title'] ) && $nice_options['nice_font_slider_title'] )
    $output .= '.flexslider .slides li h2 {' . nice_custom_font_css( $nice_options['nice_font_slider_title'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_slider_content'] ) && $nice_options['nice_font_slider_content'] )
    $output .= '.flex-caption p { ' . nice_custom_font_css( $nice_options['nice_font_slider_content'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_widget_titles'] ) && $nice_options['nice_font_widget_titles'] )
    $output .= '#sidebar .widget h3 { ' . nice_custom_font_css( $nice_options['nice_font_widget_titles'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_footer_widget_titles'] ) && $nice_options['nice_font_footer_widget_titles'] )
    $output .= '#footer-widgets h3 { ' . nice_custom_font_css( $nice_options['nice_font_footer_widget_titles'] ) . ' }' . "\n";
    if ( isset( $nice_options['nice_font_footer_widget_content'] ) && $nice_options['nice_font_footer_widget_content'] )
    $output .= '#footer-widgets .widget { ' . nice_custom_font_css( $nice_options['nice_font_footer_widget_content'] ) . ' }' . "\n";
    }
    // Add Text title and tagline if text title option is enabled
    if ( isset( $nice_options['nice_texttitle'] ) && ( nice_bool( $nice_options['nice_texttitle'] ) ) ) {
    if ( $nice_options['nice_font_site_title'] ) {
    $output .= '#header #top #logo a .text-logo { ' . nice_custom_font_css( $nice_options['nice_font_site_title'] ) . ' }' . "\n";
    }
    }
    if ( isset( $output ) && $output !== '' ) {
    $output = strip_tags( '/* Nice Custom Fonts */' . "\n\n" . $output );
    wp_add_inline_style( 'nice-options-styles', $output );
    }
    }
    endif;
    if ( ! function_exists( 'nice_load_web_fonts' ) ) :
    add_action( 'wp_head', 'nice_load_web_fonts', 15 );
    /**
    * Load web fonts.
    *
    * @since 1.0.0
    */
    function nice_load_web_fonts() {
    global $nice_options;
    $html = '';
    // Go through the options.
    if ( ( isset( $nice_options['nice_text_title'] ) && ( nice_bool( $nice_options['nice_text_title'] ) ) )
    || ( isset( $nice_options['nice_custom_typography'] ) && ( nice_bool( $nice_options['nice_custom_typography'] ) ) )
    ) {
    // Output Google Font CSS in header.
    if ( $fonts = nice_get_web_fonts_uri() ) {
    $html .= "\n\n<!-- Nice Google fonts -->\n";
    $html .= '<link href="' . $fonts . '" rel="stylesheet" type="text/css" />' . "\n";
    $html = str_replace( '|"', '"', $html );
    echo $html . "\n\n";
    }
    if ( ( ! nice_bool( $nice_options['nice_custom_typography'] ) ) ) {
    nice_default_fonts();
    }
    } else {
    // Fix for updated themes where no typography options were saved.
    nice_default_fonts();
    }
    }
    endif;
    if ( ! function_exists( 'nice_get_default_fonts_uri' ) ) :
    /**
    * Obtain URL for default fonts.
    *
    * @since 1.0.0
    */
    function nice_get_default_fonts_uri() {
    return apply_filters( 'nice_default_fonts_uri', '//fonts.googleapis.com/css?family=Bree+Serif|Gudea:400,700,400italic' );
    }
    endif;
    if ( ! function_exists( 'nice_default_fonts' ) ) :
    /**
    * HTML to load a default font.
    *
    * @since 1.0.0
    * @return string
    */
    function nice_default_fonts() {
    ob_start();
    // Start template. ?>
    <link href="<?php echo nice_get_default_fonts_uri(); ?>" rel="stylesheet" type="text/css">
    <?php // End template.
    $output = ob_get_contents();
    ob_end_clean();
    $output = apply_filters( 'nice_default_fonts', $output );
    echo $output;
    }
    endif;

    Best,
    Juan.

    That worked! Thank you so much. Please close this ticket.

    Juanfra Aldasoro

    Thank you Jess 🙂

    Have a nice day,
    Juan

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

This topic is marked as resolved

Only the topic author can re-open this thread.

Login to your Account

Welcome back! Please log in to your account by filling the fields below:

Not a member? Create a free account.

Create a Free Account