• Resolved mbroderick

    (@mbroderick)


    i copied the original divi child theme ‘functions.php’ code and saved it as a .rtf file…then I added code to change my ‘add to cart’ button text. the website and WP/admin went belly-up…blank screens. I hit the back arrow and got my WP admin back… i pasted the original code back into the functions.php and updated.

    it’s still broken! Nothing but white screens. if i hit the back arrow i get my admin back, but the website and WP admin are broken. if i update again…nothing but white screens for WP and website.
    i’m using divi and woocommerce. here’s the original code:

    <?php
    
    //* Create Portfolio Type custom taxonomy
    add_action( 'init', 'divi_type_taxonomy' );
    function divi_type_taxonomy() {
    
    	register_taxonomy( 'portfolio-type', 'portfolio',
    		array(
    			'labels' => array(
    				'name'          => _x( 'Types', 'taxonomy general name', 'divi' ),
    				'add_new_item'  => __( 'Add New Portfolio Type', 'divi' ),
    				'new_item_name' => __( 'New Portfolio Type', 'divi' ),
    			),
    			'exclude_from_search' => true,
    			'has_archive'         => true,
    			'hierarchical'        => true,
    			'rewrite'             => array( 'slug' => 'portfolio-type', 'with_front' => false ),
    			'show_ui'             => true,
    			'show_tagcloud'       => false,
    		)
    	);
    
    }
    
    //* Create portfolio custom post type
    add_action( 'init', 'divi_portfolio_post_type' );
    function divi_portfolio_post_type() {
    
    	register_post_type( 'portfolio',
    		array(
    			'labels' => array(
    				'name'          => __( 'Portfolio', 'divi' ),
    				'singular_name' => __( 'Portfolio', 'divi' ),
    			),
    			'has_archive'  => true,
    			'hierarchical' => true,
    			'menu_icon'    => 'dashicons-portfolio',
    			'public'       => true,
    			'rewrite'      => array( 'slug' => 'portfolio', 'with_front' => false ),
    			'supports'     => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'revisions', 'page-attributes' ),
    			'taxonomies'   => array( 'portfolio-type' ),
    
    		)
    	);
    
    }
    
    //* Change the number of portfolio items to be displayed (props Brad Dalton)
    add_action( 'pre_get_posts', 'divi_portfolio_items' );
    function divi_portfolio_items( $query ) {
    
    	if( $query->is_main_query() && !is_admin() && is_post_type_archive( 'portfolio' ) ) {
    		$query->set( 'posts_per_page', '12' );
    	}
    
    }
    
    /*
     * wc_remove_related_products
     *
     * Clear the query arguments for related products so none show.
     * Add this code to your theme functions.php file.
     */
     /*
    function wc_remove_related_products( $args ) {
    	return array();
    }
    */
    //add_filter('woocommerce_related_products_args','wc_remove_related_products', 10); 
    
    function woocommerce_remove_related_products(){
        remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
    }
    add_action('woocommerce_after_single_product_summary', 'woocommerce_remove_related_products');
    
    // GET 4 products
    function woocommerce_upsell_display( $posts_per_page = 4, $columns = 4, $orderby = 'rand' ) {
    woocommerce_get_template( 'single-product/up-sells.php', array(
    'posts_per_page' => $posts_per_page,
    'orderby' => $orderby,
    'columns' => $columns
    ) );
    }

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mbroderick

    (@mbroderick)

    here’s the site link

    https://www.strongholdbasements.com

    Thread Starter mbroderick

    (@mbroderick)

      Please HELP

    ….I was trying to go to another area in WP admin and now i can’t get back to theme functions.php at all. my choices are Divid Child Theme ‘style.css’ or a white screen in my WP admin section. I can’t do anything as admin anymore except look at this one screen.

    I’m afraid to log out and log in again as the white screen is scary. if i open another window and goto my admin site…white screen! its totally broken

    Thread Starter mbroderick

    (@mbroderick)

    i fixed it

    Any chance you can share? I just broke my Divi functions.php as well.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘HELP!!!!! I updated my child, functions.php and I broke my website’ is closed to new replies.