Support » Theme: Amadeus » About function.php and customization malfunction

  • Resolved maaving

    (@maaving)


    ※ For us Japanese, we are using a translation machine.
    Please pardon beforehand that it is hard to read. Excuse me.

    I wrote that I wanted to add additional functions to functions.php today and I filled in the code.
    At that time, when I created a child theme, I changed the name to functions.php because s of “functions.php” was missing and became a function.

    Although the additional function worked without problems, I noticed that the character type and size of the font was restored to their defaults, and I confirmed the customization, but they were all written as changed.

    I just imported the correct customization file just in case.
    However, the character type and size of the font do not change.

    Even if you touch directly, it changes with preview, but it does not change even if you update it.

    It seems that customization has stopped working, what should I do?

    By the way, if you return to function.php, you can use it without problems, but instead the newly added function will be useless.

    I am sorry for a long sentence.
    I am pleased if you can lend us your power.

Viewing 3 replies - 1 through 3 (of 3 total)
  • For the sake of completeness I will write the contents described in the current functions.php.

    
    <?php
    add_action( 'wp_enqueue_scripts', 'child_enqueue_styles',99);
    function child_enqueue_styles() {
        $parent_style = 'parent-style';
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( $parent_style ) );
    }
    if ( get_stylesheet() !== get_template() ) {
        add_filter( 'pre_update_option_theme_mods_' . get_stylesheet(), function ( $value, $old_value ) {
             update_option( 'theme_mods_' . get_template(), $value );
             return $old_value; // prevent update to child theme mods
        }, 10, 2 );
        add_filter( 'pre_option_theme_mods_' . get_stylesheet(), function ( $default ) {
            return get_option( 'theme_mods_' . get_template(), $default );
        } );
    }
    
    function child_categories_excerpt_shortcode( $atts ) {
    	global $post;
    
    	$atts = shortcode_atts( array(
    		'parent' => 0,
    		'count' => 5,
    	), $atts, 'child_categories_excerpt' );
    
    	$output = '';
    
    	$output .= '<div class="child-categories-excerpt">';
    	$categories = get_categories( array(
    		'orderby' => 'name',
    		'parent' => $atts['parent'],
    	) );
    	foreach ( $categories as $category ) {
    
    		// netshopping,webtool,wbsite,fashion
    		$output .= '<h3><a>term_id ) . '">' . $category->name . '</a></h3>' . "\n";
    
    		$myposts = get_posts( array(
    			'posts_per_page' => $atts['count'],
    			'category' => $category->term_id,
    		) );
    		foreach ( $myposts as $post ) {
    			setup_postdata( $post );
    
    			$output .= '<div class="child-categories-excerpt-post-container">';
    			$output .= '<h4><a href="' . get_the_permalink() . '">' . get_the_title() . '</a><h4>';
    			$output .= get_the_excerpt();
    			$output .= '</div>' . "\n";
    		}
    		wp_reset_postdata();
    	}
    	$output .= '</div>' . "\n";
    
    	return $output;
    }
    
    add_shortcode( 'child_categories_excerpt', 'child_categories_excerpt_shortcode' );
    
    • This reply was modified 1 year, 10 months ago by  maaving.

    Hey there,

    Can you tell me what exactly you want to edit using your functions.php file so we could help you better? Thank you. 🙂

    Nice to meet you!
    I solved this separately by e-mail, Thank you 🙂

    If there is anything else there is still unresolved on other topics, but I hope that you can see it by professional.

    Thank you very much.
    【WP Nivo Slider】
    Topic name: Specify image size in%
    URL: https: //wordpress.org/support/topic/specify-image-size-in/

    I would be pleased if you could tell me something you need.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘About function.php and customization malfunction’ is closed to new replies.