Community Forums › Forums › Archived Forums › General Discussion › read more link on excerpt
Tagged: read more
- This topic has 7 replies, 4 voices, and was last updated 9 years, 3 months ago by Mike Imken.
-
AuthorPosts
-
October 29, 2014 at 9:52 am #129753gswartzMember
Is it possible to have the read more link appear when you have Genesis Settings>Content Archives set to Display post excerpts? I've added the following code to my functions file but the read more link doesn't show up. From what I've found here and through google it sounds like the read more link doesn't show up unless you have it set to Display post content with a limited number of characters. Is that correct and if so, is there anyway to still make it show up (hacking a function somewhere)? Thanks.
http://www.charisholdings.com/careers/October 29, 2014 at 9:55 am #129755gswartzMemberWoops, I forgot to add the code.
add_filter(‘excerpt_more’, ‘get_read_more_link’); add_filter( ‘the_content_more_link’, ‘get_read_more_link’ ); function get_read_more_link() { return '… <a href="' . get_permalink() . '">Read More…</a>'; }
October 29, 2014 at 9:56 am #129756Genesis DeveloperMembertry this
function custom_excerpt_more( $more ) { return '...<a href="'.get_permalink().'">read more</a>'; } add_filter( 'excerpt_more', 'custom_excerpt_more' );
October 29, 2014 at 10:14 am #129762gswartzMemberThank you but nothing has changed. Do I need to do something with enabling some type of theme support?
October 29, 2014 at 10:44 am #129763Genesis DeveloperMemberare you added the code in functions.php file?
October 29, 2014 at 10:49 am #129764Brad DaltonParticipantThe last snippet in this post works as long as your Genesis > Theme Settings > Content Archives are set to Display Post Excerpts http://wpsites.net/web-design/move-the-read-more-link-position-to-the-next-line/
October 29, 2014 at 11:09 am #129768gswartzMember@genwrock, here is the code from my functions file
//* Start the engine include_once( get_template_directory() . '/lib/init.php' ); //* Setup Theme include_once( get_stylesheet_directory() . '/lib/theme-defaults.php' ); //* Set Localization (do not remove) load_child_theme_textdomain( 'parallax', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'parallax' ) ); //* Add Image upload to WordPress Theme Customizer add_action( 'customize_register', 'parallax_customizer' ); function parallax_customizer(){ require_once( get_stylesheet_directory() . '/lib/customize.php' ); } //* Include Section Image CSS include_once( get_stylesheet_directory() . '/lib/output.php' ); //* Child theme (do not remove) define( 'CHILD_THEME_NAME', 'Parallax Pro Theme' ); define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/parallax/' ); define( 'CHILD_THEME_VERSION', '1.2' ); //* Enqueue scripts and styles add_action( 'wp_enqueue_scripts', 'parallax_enqueue_scripts_styles' ); function parallax_enqueue_scripts_styles() { wp_enqueue_script( 'parallax-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_style( 'dashicons' ); wp_enqueue_style( 'parallax-google-fonts', '//fonts.googleapis.com/css?family=Montserrat|Sorts+Mill+Goudy', array(), CHILD_THEME_VERSION ); } //* Add HTML5 markup structure add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); //* Add viewport meta tag for mobile browsers add_theme_support( 'genesis-responsive-viewport' ); //* Reposition the primary navigation menu remove_action( 'genesis_after_header', 'genesis_do_nav' ); add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_nav' ); //* Reposition the secondary navigation menu remove_action( 'genesis_after_header', 'genesis_do_subnav' ); add_action( 'genesis_footer', 'genesis_do_subnav', 7 ); //* Reduce the secondary navigation menu to one level depth add_filter( 'wp_nav_menu_args', 'parallax_secondary_menu_args' ); function parallax_secondary_menu_args( $args ){ if( 'secondary' != $args['theme_location'] ) return $args; $args['depth'] = 1; return $args; } //* Unregister layout settings genesis_unregister_layout( 'content-sidebar-sidebar' ); genesis_unregister_layout( 'sidebar-content-sidebar' ); genesis_unregister_layout( 'sidebar-sidebar-content' ); //* Add support for additional color styles add_theme_support( 'genesis-style-selector', array( 'parallax-pro-blue' => __( 'Parallax Pro Blue', 'parallax' ), 'parallax-pro-green' => __( 'Parallax Pro Green', 'parallax' ), 'parallax-pro-orange' => __( 'Parallax Pro Orange', 'parallax' ), 'parallax-pro-pink' => __( 'Parallax Pro Pink', 'parallax' ), ) ); //* Unregister secondary sidebar unregister_sidebar( 'sidebar-alt' ); //* Add support for custom header add_theme_support( 'custom-header', array( 'width' => 152, 'height' => 77, 'header-selector' => '.site-title a', 'header-text' => false, ) ); //* Add support for structural wraps add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'footer-widgets', 'footer', ) ); //* Modify the size of the Gravatar in the author box add_filter( 'genesis_author_box_gravatar_size', 'parallax_author_box_gravatar' ); function parallax_author_box_gravatar( $size ) { return 176; } //* Modify the size of the Gravatar in the entry comments add_filter( 'genesis_comment_list_args', 'parallax_comments_gravatar' ); function parallax_comments_gravatar( $args ) { $args['avatar_size'] = 120; return $args; } //* Add support for 3-column footer widgets add_theme_support( 'genesis-footer-widgets', 1 ); //* Add support for after entry widget add_theme_support( 'genesis-after-entry-widget-area' ); //* Relocate after entry widget remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' ); add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 5 ); //* Register widget areas genesis_register_sidebar( array( 'id' => 'home-section-1', 'name' => __( 'Home Section 1', 'parallax' ), 'description' => __( 'This is the home section 1 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-2', 'name' => __( 'Home Section 2', 'parallax' ), 'description' => __( 'This is the home section 2 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-3', 'name' => __( 'Home Section 3', 'parallax' ), 'description' => __( 'This is the home section 3 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-4', 'name' => __( 'Home Section 4', 'parallax' ), 'description' => __( 'This is the home section 4 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-5', 'name' => __( 'Home Section 5', 'parallax' ), 'description' => __( 'This is the home section 5 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-6', 'name' => __( 'Home Section 6', 'parallax' ), 'description' => __( 'This is the home section 6 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-7', 'name' => __( 'Home Section 7', 'parallax' ), 'description' => __( 'This is the home section 7 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-8', 'name' => __( 'Home Section 8', 'parallax' ), 'description' => __( 'This is the home section 8 section.', 'parallax' ), ) ); genesis_register_sidebar( array( 'id' => 'home-section-9', 'name' => __( 'Home Section 9', 'parallax' ), 'description' => __( 'This is the home section 9 section.', 'parallax' ), ) ); //* add blog header image div add_action( 'genesis_after_header', 'add_blog_header' ); function add_blog_header(){ if (is_home()){ echo '<div id="dvBlogHeader"><div class="inner"><h1>Careers</h1><p>We are always looking for talented individuals to come along for the wild ride and help us make a difference in our customers\'s lives. We work hard, but we have fun, too!</div></div>'; } } //* Add Read More Link to Excerpts function custom_excerpt_more( $more ) { return '...<a href="'.get_permalink().'">read more</a>'; } add_filter( 'excerpt_more', 'custom_excerpt_more' );
@braddalton, that's what I have set.December 29, 2014 at 10:21 am #135551Mike ImkenMember@gswartz -- are you using custom post excerpts? I was, and similarly found these solutions were not working.
I posted this in another Studiopress thread after it solved it:
This is an old question, but I was looking for a solution as well and no one has seemed to answer it properly here on the forums.
The issue is with the custom post excerpts. These solutions don't work for it in my experience.
This however solved it, courtesy of WPBeaches. Just change the themeprefix and adjust the CSS using the "more-link" class.
//Read More Button For Excerpt function themeprefix_excerpt_read_more_link( $output ) { global $post; return $output . ' <a href="' . get_permalink( $post->ID ) . '" class="more-link" title="Read More">Read More</a>'; } add_filter( 'the_excerpt', 'themeprefix_excerpt_read_more_link' );
Marketer – Designer – Developer
http://www.TargetPublic.com -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.