Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • WP

    (@linuxpanda)

    Its not working the way it should with priority greater than 10.

    So the priority should be “9 or less” for this particular function since we are overriding the function.

    WP

    (@linuxpanda)

    WP

    (@linuxpanda)

    Use the following format to change the colour of the links in content area. 🙂

    .site-content .entry-content a {
    }
    
    .site-content .entry-content a:hover {
    }
    
    .site-content .entry-content a:active {
    }
    
    .site-content .entry-content a:visited {
    }
    WP

    (@linuxpanda)

    A small correction.

    We should use priority of “11 or higher” to make sure the child theme functions will be loaded last.

    So the correct code will be,

    <?php
    
    /**
     * Add action to remove parent function "expound_setup" using function "remove_expound_setup"
     * Parent theme uses the default priority of 10
     * We are using priority 99 to make sure the child theme functions will be loaded last
     */
    add_action( 'after_setup_theme', 'remove_expound_setup', 99 );
    
    // Remove parent function "expound_setup" and override it with "override_expound_setup" function
    function remove_expound_setup () {
    	remove_action( 'after_setup_theme', 'expound_setup' );
    	add_action( 'after_setup_theme', 'override_expound_setup' );
    }
    
    if ( ! function_exists( 'override_expound_setup' ) ) :
    /**
     * Sets up theme defaults and registers support for various WordPress features.
     *
     * Note that this function is hooked into the after_setup_theme hook, which runs
     * before the init hook. The init hook is too late for some features, such as indicating
     * support post thumbnails.
     */
    function override_expound_setup() {
    
    	/**
    	 * Custom template tags for this theme.
    	 */
    	require( get_template_directory() . '/inc/template-tags.php' );
    
    	/**
    	 * Custom functions that act independently of the theme templates
    	 */
    	require( get_template_directory() . '/inc/extras.php' );
    
    	/**
    	 * Customizer additions
    	 */
    	require( get_template_directory() . '/inc/customizer.php' );
    
    	/**
    	 * Make theme available for translation
    	 * Translations can be filed in the /languages/ directory
    	 * If you're building a theme based on Mag, use a find and replace
    	 * to change 'expound' to the name of your theme in all the template files
    	 */
    	load_theme_textdomain( 'expound', get_template_directory() . '/languages' );
    
    	/**
    	 * Add default posts and comments RSS feed links to head
    	 */
    	add_theme_support( 'automatic-feed-links' );
    
    	/**
    	 * Editor styles for the win
    	 */
    	add_editor_style( 'css/editor-style.css' );
    
    	/**
    	 * Enable support for Post Thumbnails on posts and pages
    	 *
    	 * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
    	 */
    	add_theme_support( 'post-thumbnails' );
    	set_post_thumbnail_size( 220, 126, true );
    	add_image_size( 'expound-featured', 460, 260, true );
    	add_image_size( 'expound-mini', 50, 50, true );
    
    	/**
    	 * This theme uses wp_nav_menu() in one location.
    	 */
    /*
     * Original menu for reference
     *
     *
     	register_nav_menus( array(
    		'primary' => __( 'Primary Menu', 'expound' ),
    		'social' => __( 'Social Menu', 'expound' ),
    	) );
    *
    *
    * */
    	register_nav_menus( array(
    		'top' => __( 'Top Navigation' ),
    		'main' => __( 'Main navigation' )
    	));
    
    	/**
    	 * Enable support for Post Formats
    	 */
    	add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );
    
    	/**
    	 * Enable support for Custom Background
    	 */
    	add_theme_support( 'custom-background', array(
    		'default-color' => '333333',
    	) );
    }
    endif; // expound_setup
    WP

    (@linuxpanda)

    You can do that by by editing the template-tags.php in the inc directory.

    Find: (line 134)
    sprintf( '<a class="entry-date" href="%s">%s</a>', esc_url( get_permalink() ), $output_time )

    Replace:
    sprintf( '<a class="entry-date" href="%s">%s</a>', esc_url( get_permalink() ), $regular_time )

    Find: (line 209)
    sprintf( '<a class="entry-date" href="%s">%s</a>', esc_url( get_permalink() ), $output_time ),

    Replace:
    sprintf( '<a class="entry-date" href="%s">%s</a>', esc_url( get_permalink() ), $regular_time ),

    WP

    (@linuxpanda)

    What do you want to include in the footer?

    As mentioned in the 2nd post, you can add that code to functions.php in your child theme. Then copy paste the footer.php file to your child thema and add an action to include your custom copyright.

    If you want to change the way the footer is displayed, then you need to edit the CSS related to footer.

    WP

    (@linuxpanda)

    Create a child theme and in functions.php, you can override the “expound_setup” function and add custom menu.

    <?php
    
    /**
     * Add action to remove parent function "expound_setup" using function "remove_expound_setup"
     * Parent theme uses the default priority of 10
     * So use a priority of 9 to load before the parent theme
     */
    add_action( 'after_setup_theme', 'remove_expound_setup', 9 );
    
    // Remove parent function "expound_setup" and override it with "override_expound_setup" function
    function remove_expound_setup () {
    	remove_action( 'after_setup_theme', 'expound_setup' );
    	add_action( 'after_setup_theme', 'override_expound_setup' );
    }
    
    if ( ! function_exists( 'override_expound_setup' ) ) :
    /**
     * Sets up theme defaults and registers support for various WordPress features.
     *
     * Note that this function is hooked into the after_setup_theme hook, which runs
     * before the init hook. The init hook is too late for some features, such as indicating
     * support post thumbnails.
     */
    function override_expound_setup() {
    
    	/**
    	 * Custom template tags for this theme.
    	 */
    	require( get_template_directory() . '/inc/template-tags.php' );
    
    	/**
    	 * Custom functions that act independently of the theme templates
    	 */
    	require( get_template_directory() . '/inc/extras.php' );
    
    	/**
    	 * Customizer additions
    	 */
    	require( get_template_directory() . '/inc/customizer.php' );
    
    	/**
    	 * Make theme available for translation
    	 * Translations can be filed in the /languages/ directory
    	 * If you're building a theme based on Mag, use a find and replace
    	 * to change 'expound' to the name of your theme in all the template files
    	 */
    	load_theme_textdomain( 'expound', get_template_directory() . '/languages' );
    
    	/**
    	 * Add default posts and comments RSS feed links to head
    	 */
    	add_theme_support( 'automatic-feed-links' );
    
    	/**
    	 * Editor styles for the win
    	 */
    	add_editor_style( 'css/editor-style.css' );
    
    	/**
    	 * Enable support for Post Thumbnails on posts and pages
    	 *
    	 * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
    	 */
    	add_theme_support( 'post-thumbnails' );
    	set_post_thumbnail_size( 220, 126, true );
    	add_image_size( 'expound-featured', 460, 260, true );
    	add_image_size( 'expound-mini', 50, 50, true );
    
    	/**
    	 * This theme uses wp_nav_menu() in one location.
    	 */
    /*
     * Original menu for reference
     *
     *
     	register_nav_menus( array(
    		'primary' => __( 'Primary Menu', 'expound' ),
    		'social' => __( 'Social Menu', 'expound' ),
    	) );
    *
    *
    * */
    	register_nav_menus( array(
    		'top' => __( 'Top Navigation' ),
    		'main' => __( 'Main navigation' )
    	));
    
    	/**
    	 * Enable support for Post Formats
    	 */
    	add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );
    
    	/**
    	 * Enable support for Custom Background
    	 */
    	add_theme_support( 'custom-background', array(
    		'default-color' => '333333',
    	) );
    }
    endif; // expound_setup
    WP

    (@linuxpanda)

    You can do that by adding a plugin like, http://wordpress.org/plugins/fitvids-for-wordpress/, or some other plugin like that.

    WP

    (@linuxpanda)

    You can remove related posts by removing the following line from single.php file.

    <?php get_template_part( 'related-content' ); ?>

    But the proper way to do that is to make a child theme, copy the single.php file to your child theme and then remove that line in the child theme.

    WP

    (@linuxpanda)

    Did you make any custom edits?

    WP

    (@linuxpanda)

    Please use this plugin to regenerate thumbnails.

    http://wordpress.org/plugins/regenerate-thumbnails/

    WP

    (@linuxpanda)

    I think its not possible to cannot change the excerpt length for just the secondary featured area as the codes for excerpt length are in the wordpress core files.

    You can change the excerpt length for all posts in functions.php.

    /**
     * Change excerpt length to 10. Default is 55.
     */
    function custom_excerpt_length( $length ) {
    	return 10;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

    http://codex.wordpress.org/Function_Reference/the_excerpt#Control_Excerpt_Length_using_Filters

    /**
     * Change excerpt length to 0 and remove the ... that is displayed.
     */
    function custom_excerpt_length( $length ) {
    	return 0;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
    
    function custom_excerpt_more( $more ) {
    	return '';
    }
    add_filter( 'excerpt_more', 'custom_excerpt_more', 999 );

    http://codex.wordpress.org/Plugin_API/Filter_Reference/excerpt_more
    `

    WP

    (@linuxpanda)

    No need for editing any files.

    Go to widgets and remove all the widgets from the sidebar which will make the posts to display in full width.

    WP

    (@linuxpanda)

    Not sure what he meant by “duplicate tables”. But those 4 posts can be made to be displayed as 2 posts per line.

    In expound.css

    Find:

    .featured-content-secondary article {
      margin-left: 10px;
      margin-right: 10px;
      width: 220px;
      float: left;
    }

    Replace with:

    .featured-content-secondary article {
      margin-left: 40px;
      margin-right: 40px;
      width: 440px;
      float: left;
    }

    Its much better if you make a child them to do this so that custom edits are preserved after theme update.

    /*
    Theme Name: Expound Child
    Template: expound
    */
    
    @import url("../expound/style.css");
    
    /* =Theme customization starts here
    -------------------------------------------------------------- */
    
    .featured-content-secondary article {
      margin-left: 40px;
      margin-right: 40px;
      width: 440px;
      float: left;
    }
Viewing 14 replies - 1 through 14 (of 14 total)