WordPress.org

Ready to get started?Download WordPress

Forums

Getting blank page when trying to update style.css (4 posts)

  1. RLL18
    Member
    Posted 7 months ago #

    So as the title states, I am not able to update the style.css file. I can update any other file, however. I have tried disabling all plugins. I have tried re-installing my theme. It is neither of those issues. I went into debugging mode and on my homepage I saw these errors:

    Notice: Undefined index: woo_homepage_tweet in /home/thymefli/public_html/thecraftingtable.net/wp-content/themes/artificer/index.php on line 141

    Notice: Undefined index: woo_homepage_tweet in /home/thymefli/public_html/thecraftingtable.net/wp-content/themes/artificer/index.php on line 167

    This is my index.php file:

    <?php
    /**
     * Index Template
     *
     * Here we setup all logic and XHTML that is required for the index template, used as both the homepage
     * and as a fallback template, if a more appropriate template file doesn't exist for a specific context.
     *
     * @package WooFramework
     * @subpackage Template
     */
    	get_header();
    	global $woo_options;
    
    ?>
    
        <div id="content" class="col-full">
    
        	<?php woo_main_before(); ?>
    
        	<div class="home-intro">
    
        	<h1 class="stand-first"><?php bloginfo('name'); ?></h1>
    
        	<?php if( isset( $woo_options['woo_stand_first'] ) ) {
    			echo '<div class="stand-first">';
    	        echo stripslashes( $woo_options['woo_stand_first'] );
    	        echo '</div>';
    		} ?>
    
    		<?php if ( is_woocommerce_activated() ) { ?>
    
        	<ul class="featured-products">
        	<!-- The first 3 -->
        	<?php
    		$args = array( 'post_type' => 'product', 'posts_per_page' => 3, 'meta_query' => array( array('key' => '_visibility','value' => array('catalog', 'visible'),'compare' => 'IN'),array('key' => '_featured','value' => 'yes')) );
    		$loop = new WP_Query( $args );
    
    		while ( $loop->have_posts() ) : $loop->the_post(); $_product;
    
    		if ( function_exists( 'get_product' ) ) {
    			$_product = get_product( $loop->post->ID );
    		} else {
    			$_product = new WC_Product( $loop->post->ID );
    		}
    
    		?><li class="featured">
    
    					<?php //woocommerce_show_product_sale_flash( $post, $_product ); ?>
    					<a href="<?php echo get_permalink( $loop->post->ID ) ?>" title="<?php echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID); ?>">
    						<?php if (has_post_thumbnail( $loop->post->ID )) echo get_the_post_thumbnail($loop->post->ID, 'shop_catalog'); else echo '<img src="'.woocommerce_placeholder_img_src().'" alt="Placeholder" />'; ?>
    
    					<h3><?php the_title(); ?> <span class="price"><?php echo $_product->get_price_html(); ?></span></h3>
    
    					</a>
    
    			</li><?php endwhile; ?><!-- the large 1 --><?php
    		$args = array( 'post_type' => 'product', 'posts_per_page' => 1, 'offset' => 3, 'meta_query' => array( array('key' => '_visibility','value' => array('catalog', 'visible'),'compare' => 'IN'),array('key' => '_featured','value' => 'yes')) );
    		$loop = new WP_Query( $args );
    		while ( $loop->have_posts() ) : $loop->the_post();
    		if ( function_exists( 'get_product' ) ) {
    			$_product = get_product( $loop->post->ID );
    		} else {
    			$_product = new WC_Product( $loop->post->ID );
    		}
    		?><li class="featured">
    
    					<?php //woocommerce_show_product_sale_flash( $post, $_product ); ?>
    					<a href="<?php echo get_permalink( $loop->post->ID ) ?>" title="<?php echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID); ?>">
    						<?php if (has_post_thumbnail( $loop->post->ID )) echo get_the_post_thumbnail($loop->post->ID, 'shop_single'); else echo '<img src="'.woocommerce_placeholder_img_src().'" alt="Placeholder" />'; ?>
    
    					<h3><?php the_title(); ?> <span class="price"><?php echo $_product->get_price_html(); ?></span></h3>
    
    					</a>
    
    				</li><?php endwhile; ?><!-- the last 3 --><?php
    		$args = array( 'post_type' => 'product', 'posts_per_page' => 3, 'offset' => 4, 'meta_query' => array( array('key' => '_visibility','value' => array('catalog', 'visible'),'compare' => 'IN'),array('key' => '_featured','value' => 'yes')) );
    		$loop = new WP_Query( $args );
    		while ( $loop->have_posts() ) : $loop->the_post(); $_product;
    		if ( function_exists( 'get_product' ) ) {
    			$_product = get_product( $loop->post->ID );
    		} else {
    			$_product = new WC_Product( $loop->post->ID );
    		}
    		?><li class="featured">
    
    					<?php //woocommerce_show_product_sale_flash( $post, $_product ); ?>
    					<a href="<?php echo get_permalink( $loop->post->ID ) ?>" title="<?php echo esc_attr($loop->post->post_title ? $loop->post->post_title : $loop->post->ID); ?>">
    						<?php if (has_post_thumbnail( $loop->post->ID )) echo get_the_post_thumbnail($loop->post->ID, 'shop_catalog'); else echo '<img src="'.woocommerce_placeholder_img_src().'" alt="Placeholder" />'; ?>
    
    					<h3><?php the_title(); ?> <span class="price"><?php echo $_product->get_price_html(); ?></span></h3>
    
    					</a>
    
    				</li><?php endwhile; ?>
    		</ul>
    
    		<?php } ?>
    
    		</div><!--/.home-intro-->
    
    		<section id="main" class="<?php if ( $woo_options[ 'woo_homepage_tweet' ] == "false" && $woo_options[ 'woo_display_store_info' ] == "false" ) echo 'fullwidth'; else echo 'col-left'; ?>">
    
    		<?php woo_loop_before(); ?>
    
    		<?php
    
    			$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; query_posts( array( 'post_type' => 'post', 'paged' => $paged, 'posts_per_page' => 1 ) );
            	if ( have_posts() ) : $count = 0;
            ?>
    
    			<?php /* Start the Loop */ ?>
    			<?php while ( have_posts() ) : the_post(); $count++; ?>
    
    				<?php
    					/* Include the Post-Format-specific template for the content.
    					 * If you want to overload this in a child theme then include a file
    					 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
    					 */
    					get_template_part( 'content', get_post_format() );
    				?>
    
    			<?php endwhile; ?>
    
    		<?php else : ?>
    
                <article <?php post_class(); ?>>
                    <p><?php _e( 'Sorry, no posts matched your criteria.', 'woothemes' ); ?></p>
                </article><!-- /.post -->
    
            <?php endif; ?>
    
            <?php woo_loop_after(); ?>
    
    		</section><!-- /#main -->
    
    		<?php woo_main_after(); ?>
    
    		<?php if ( $woo_options[ 'woo_homepage_tweet' ] == "true" || $woo_options[ 'woo_display_store_info' ] == "true" ) { ?>
    		<aside id="sidebar" class="col-right">
    		<?php } ?>
    			<?php if ( $woo_options[ 'woo_display_store_info' ] == "true" ) {
    			$email = get_option('woo_store_email_address');
    			$phone = get_option('woo_store_phone_number');
    			$twitterID = get_option('woo_contact_twitter');
    			?>
    				<ul class="store-info">
    
    					<li class="phone">
    						<div class="inner">
    							<span><?php _e('Call us:','woothemes'); ?></span>
    							<a href="tel:<?php echo $phone; ?>"><?php echo $phone; ?></a>
    						</div>
    					</li>
    
    					<li class="email">
    						<div class="inner">
    							<span><?php _e('Send us an email:','woothemes'); ?></span>
    							<a href="mailto:<?php echo $email; ?>" title="<?php _e('Send us an email', 'woothemes')?>"><?php echo $email; ?></a>
    						</div>
    					</li>
    
    				</ul><!--/.store-info-->
    			<?php } ?>
    		<?php if ( $woo_options[ 'woo_homepage_tweet' ] == "true" || $woo_options[ 'woo_display_store_info' ] == "true" ) { ?>
    		</aside>
    		<?php } ?>
    
            <?php //get_sidebar(); ?>
    
        </div><!-- /#content -->
    
    <?php get_footer(); ?>

    I don't see, however, how that can fix my style.css problem if these issues are resolved.

    So in all, I need 2 things repaired. 1. How can I update my style.css without seeing just a blank page
    2. How do I correct these notices??

    I have tried EVERYTHING I can think of including clearing out my cache. Please help me figure this out!

  2. Chris
    Member
    Posted 7 months ago #

    As you suspected, the notices should not be the cause of your problem with the style.css file. And it also might not be a good idea to edit a theme file directly. Two other things come to mind:

    In you current style.css (if that's the one you're talking about) it says

    "WARNING! DO NOT EDIT THIS FILE!
    To make it easy to update your theme, you should not edit the styles in this file. Instead use
    the custom.css file to add your styles. You can copy a style from this file and paste it in
    custom.css"

    Have you tried using the custom.css instead?

    Another thing you could do is to update the styles.css so it won't work and then check the URL (http://....table.net/wp-content/themes/artificer/style.css) with a tool like http://web-sniffer.net/
    If the status is not "Status: HTTP/1.1 200 OK" you might get a server error msg instead (or at least a hint).

    And if you really want to correct the notices you can do so by checking for the existence of the variables mentioned first. I've copy/pasted your code and my line number seems a bit different?!

    Line 141 (for me it's line 138)
    <?php if ( ( isset( $woo_option['woo_homepage_tweet'] ) && $woo_options[ 'woo_homepage_tweet' ] == "true" ) || ( isset( $woo_options['woo_display_store_info'] ) && $woo_options[ 'woo_display_store_info' ] == "true" ) ) { ?>

    Line 167 (for me it's line 164)
    <?php if ( ( isset( $wpp_options['woo_homepage_tweet'] ) && $woo_options[ 'woo_homepage_tweet' ] == "true" ) || ( isset( $woo_options['woo_display_store_info'] ) && $woo_options[ 'woo_display_store_info' ] == "true" ) ) { ?>

  3. RLL18
    Member
    Posted 7 months ago #

    And if you really want to correct the notices you can do so by checking for the existence of the variables mentioned first. I've copy/pasted your code and my line number seems a bit different?!

    I don't understand what you mean by this... I've seen the code, but am unsure what to do about it.

    (thank you for the quick response, by the way)

    That site you linked me said the page was "ok", so i'm still really confused. I have used custom.css and will continue to use it. It just concerns me that the file is doing that. If it does it for any other file I won't know how to fix the issue.

  4. WPShowCase
    Inactive
    Posted 7 months ago #

    isset checks whether a variable exists - so you could remove the errors above by adding isset to the theme's php like Chris has shown you above.

    However style.css is not intended to be edited in this theme - so if you only edit files that are intended to be edited then you might not encounter any problems.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.