Viewing 12 replies - 16 through 27 (of 27 total)
  • About the code you wrote here: You didn’t close the backticks, that’s why the “box” doesn’t appear.

    About your page, what’s the problem now?
    It trims the content before more tag..

    Thread Starter gpont

    (@gpont)

    Hm. NExt time I will close.

    I do not see the content to be trimmed. I see code itself above the posts then all posts completely. I tested in several browsers.

    Well I didn’t saw it before.
    Hey but what have you done?
    I clearly told you what replace with what, you put the replacement somewhere else :D. And outside php tags.
    Nevermind, copy and paste this whole template:

    <?php
    /*
    * Template Name: Blog Posts
    * @package Customizr
    * @since Customizr 3.0.12
    */
    ?>
    
    <?php do_action( '__before_main_wrapper' ); ##hook of the header with get_header ?>
    <?php tc__f('rec' , __FILE__ , __FUNCTION__ ); ?>
    <div id="main-wrapper" class="container">
    
    <?php do_action( '__before_main_container' ); ##hook of the featured page (priority 10) and breadcrumb (priority 20)...and whatever you need! ?>
    
    <div class="container" role="main">
    <div class="row">
    
    <?php do_action( '__before_article_container'); ##hook of left sidebar?>
    
    <?php query_posts('post_type=post&post_status=publish&posts_per_page=10&paged='. get_query_var('paged')); 
    
    // properly display more tag
    global $more;
    $more = 0; 
    
    // change "more" text
    add_filter( 'the_content_more_link', 'my_more_link', 10, 2 );
    function my_more_link( $more_link, $more_link_text ) {
        /*standard customizr "more" for the content, change this string if you want, e.g. => $custom_more = "Read more..." ; */
        $custom_more = __( 'Continue reading <span class="meta-nav">&rarr;</span>' , 'customizr' );
    	return str_replace( $more_link_text, $custom_more, $more_link );
    }
    
    ?>
    
    <div class="<?php echo tc__f( '__screen_layout' , tc__f ( '__ID' ) , 'class' ) ?> article-container">
    
    <?php do_action ('__before_loop');##hooks the header of the list of post : archive, search... ?>
    
    <?php if ( tc__f('__is_no_results') || is_404() ) : ##no search results or 404 cases ?>
    <article <?php tc__f('__article_selectors') ?>>
    <?php do_action( '__loop' ); ?>
    </article>
    <?php endif; ?>
    
    <?php if ( have_posts() && !is_404() ) : ?>
    <?php while ( have_posts() ) : ##all other cases for single and lists: post, custom post type, page, archives, search, 404 ?>
    <?php the_post(); ?>
    <article <?php tc__f('__article_selectors') ?>>
    <?php
    do_action( '__loop' );
    ?>
    </article>
    <?php endwhile; ?>
    
    <?php endif; ##end if have posts ?>
    
    <?php do_action ('__after_loop');##hook of the comments and the posts navigation with priorities 10 and 20 ?>
    
    </div><!--.article-container -->
    
    <?php wp_reset_query(); ?>
    
    <?php do_action( '__after_article_container'); ##hook of left sidebar?>
    
    </div><!--.row -->
    </div><!-- .container role: main -->
    
    <?php do_action( '__after_main_container' ); ?>
    
    </div><!--#main-wrapper"-->
    
    <?php do_action( '__after_main_wrapper' );##hook of the footer with get_get_footer ?>
    Thread Starter gpont

    (@gpont)

    Fatal error: Cannot redeclare my_more_link() (previously declared in /var/www/data1/S4-168/foamfatale/wp-content/themes/customizr-child/functions.php:61) in /var/www/data1/S4-168/foamfatale/wp-content/themes/customizr-child/blog.php on line 32

    What are you doing? You’re using both versions? Why?
    There’s something wrong in our communication..
    Don’t use your template, use the last one I gave you.

    Thread Starter gpont

    (@gpont)

    I cleared the content of my blog.php file, pasted your content into it and saved. All other parts are intact. Where did I fail?

    Oh, I didn’t read completely that error, my fault!
    So you’re already using a filter to change the “more” text link.
    Ok, then you don’t need this at all:

    // change "more" text
    add_filter( 'the_content_more_link', 'my_more_link', 10, 2 );
    function my_more_link( $more_link, $more_link_text ) {
        /*standard customizr "more" for the content, change this string if you want, e.g. => $custom_more = "Read more..." ; */
        $custom_more = __( 'Continue reading <span class="meta-nav">&rarr;</span>' , 'customizr' );
    	return str_replace( $more_link_text, $custom_more, $more_link );
    }

    Remove it from the page template.

    And finally we GOT IT! ??
    Sorry for my previous error.

    Thread Starter gpont

    (@gpont)

    Bingo! Call yourself simply magician ??

    Many thanks for your efforts and valuable help!

    May i mark this topic resolved?

    If you think is resolved, of course you can, that’s your topic! ??

    Thread Starter gpont

    (@gpont)

    Thanks, d4z_c0nf!

    You’re welcome, glad you solved!

Viewing 12 replies - 16 through 27 (of 27 total)
  • The topic ‘"more tag" doesn't work’ is closed to new replies.