Forum Replies Created

Viewing 15 replies - 46 through 60 (of 143 total)
  • This is the height of the header, which is formed from several properties. Try for example:
    .ast-site-identity{padding-top:0;padding-bottom:0;}
    If you use a transparent header, you can change the color of the menu in the settings of the transparent header.
    Button color adjustment is also available.

    for ul:

    .ast-header-break-point .main-header-bar .main-header-bar-navigation .main-header-menu {
        background-color: black;
    }

    for ul ul:

    .ast-header-break-point .main-header-bar .main-header-bar-navigation .menu-item-has-children .sub-menu {
        background-color: black;
    }

    For example, here: Appearance → Customize → Additional CSS. Or in a child theme.

    .main-header-bar {background-color: black;}
    or for min-width: 769px

    @media (min-width: 769px) {
    .main-header-bar {background-color: black;}
    }

    submenu
    .ast-desktop .astra-menu-animation-fade>.menu-item>.sub-menu {background-color: black;}

    Thread Starter zabavljaev

    (@zabavljaev)

    If I set empty for excerpt_more, then there will not be three dots (…).
    I don’t know how important screen-reader-text is, but it’s very noble of you to do this.

    Thread Starter zabavljaev

    (@zabavljaev)

    Please see if this can be done this way:

    function new_excerpt_more($more) {
        return '';
    }
    add_filter('excerpt_more', 'new_excerpt_more', 21 );
    
    function the_excerpt_more_link( $excerpt ){
        $read_more_text    = apply_filters( 'astra_post_read_more', __( 'Read More »', 'astra' ) );
        $excerpt .= '<p class="read-more"><a class="my-read-more" href="'. get_permalink( get_the_ID() ) . '">' . $read_more_text . '</a></p>';
        return $excerpt;
    }
    add_filter( 'the_excerpt', 'the_excerpt_more_link', 21 );

    I’m afraid to do something stupid …

    Thread Starter zabavljaev

    (@zabavljaev)

    Thanks! You understood me correctly. I could change the number of words by applying a filter:

    add_filter( 'excerpt_length', function($length) {
        return 20;
    } );

    But I need the link to be shown for any number of words, as well as for their absence. Could you show how to use “astra_the_excerpt_after”?

    Thread Starter zabavljaev

    (@zabavljaev)

    Thanks! I know about these settings. But I have posts where there is a little text and there is also a custom template where there is no text at all. In this case, you can only click on the title, but I wanted the link “read more” also to be. The link also does not appear if I fill out the “excerpt” field on the post editing page. But I would like the link to be there too.
    I am just an amateur and do not know some things. Sorry if I ask questions that are not directly related to Astra!

    • This reply was modified 4 years, 9 months ago by zabavljaev.
    Thread Starter zabavljaev

    (@zabavljaev)

    I took as a basis the function of the theme Astra:

    /**
     * Function to get Read More Link of Post
     *
     * @since 1.0.0
     * @return html
     */
    if ( ! function_exists( 'astra_post_link' ) ) {
    
    	/**
    	 * Function to get Read More Link of Post
    	 *
    	 * @param  string $output_filter Filter string.
    	 * @return html                Markup.
    	 */
    	function astra_post_link( $output_filter = '' ) {
    
    		$enabled = apply_filters( 'astra_post_link_enabled', '__return_true' );
    		if ( ( is_admin() && ! wp_doing_ajax() ) || ! $enabled ) {
    			return $output_filter;
    		}
    
    		$read_more_text    = apply_filters( 'astra_post_read_more', __( 'Read More &raquo;', 'astra' ) );
    		$read_more_classes = apply_filters( 'astra_post_read_more_class', array() );
    
    		$post_link = sprintf(
    			esc_html( '%s' ),
    			'<a class="' . esc_attr( implode( ' ', $read_more_classes ) ) . '" href="' . esc_url( get_permalink() ) . '"> ' . the_title( '<span class="screen-reader-text">', '</span>', false ) . ' ' . $read_more_text . '</a>'
    		);
    
    		$output = ' &hellip;<p class="read-more"> ' . $post_link . '</p>';
    
    		return apply_filters( 'astra_post_link', $output, $output_filter );
    	}
    }
    add_filter( 'excerpt_more', 'astra_post_link', 1 );

    And wrote my code:

    function my_excerpt_more( $more ) {
     $read_more_text    = apply_filters( 'astra_post_read_more', __( 'Read More &raquo;', 'astra' ) );
        return ' <a class="my-read-more" href="'. get_permalink( get_the_ID() ) . '">' . $read_more_text . '</a>';
    }
    add_filter( 'excerpt_more', 'my_excerpt_more' );

    But now <p class = “read-more”> is missing. Help, please write the function correctly.
    I just wanted to know why the link does not have a class … I do not need to add it, but maybe it will be useful to someone. Thanks!
    For example, like this:

    function my_excerpt_more( $more ) {
     $read_more_text    = apply_filters( 'astra_post_read_more', __( 'Read More &raquo;', 'astra' ) );
        return ' <p class="read-more"><a class="my-read-more" href="'. get_permalink( get_the_ID() ) . '">' . $read_more_text . '</a></p>';
    }
    add_filter( 'excerpt_more', 'my_excerpt_more' );

    But I don’t know if it will be right

    There are many ways. For example, you can use jQuery to remove the href attribute. You also have to remove the title attribute.

    Thread Starter zabavljaev

    (@zabavljaev)

    I could do it with jQuery, but I would like with functions.php.
    jQuery("p.read-more a").addClass("myclass");
    This is optional for me, as I can use the CSS construct .read-more a {…}. However, I would like to know why the link class is empty.

    I can’t choose the penultimate li:after.
    remove “post title”:
    .trail-items > .trail-item:last-child {display:none}
    or
    .trail-items li:last-of-type{display:none}

    Try it like this:
    .ast-breadcrumbs .trail-item:nth-child(2n):after {display:none}
    : or :: – works the same. Are you sure you really need to cut breadcrumbs? I would not do that.
    Experiment with the pseudo-classes: first-child,: last-child,: nth-child (0,1,2 …). Must look with subcategories. Until I see how to do it.
    I think, however, that this is not possible, since each entry may have a different number of categories and subcategories. Nothing to catch on.

    Many thanks! I use the free version of the theme. Firstly, buying an Astra PRO theme is expensive (for me), and secondly, I like to do it myself.

Viewing 15 replies - 46 through 60 (of 143 total)