This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Replies

4
  1. Przemysław Otulakowski 7 years, 5 months ago
    /* translators: %s: Name of current post */
    			$content = get_the_content();
    			$string = preg_replace('/\[.*?\]/', '', $content);
    			$trimmed_content = wp_trim_words( $string, 30, NULL );
    			echo $trimmed_content;

    I’m use standard preg_replace. Solved problem

  2. Alex S Staff 7 years, 5 months ago

    Hi Przemysław,

    I’m glad to hear you were able to resolve this issue. I’m sorry I wasn’t able to be of assistance this time. Also, thank you for posting your solution. With that said, can you please elaborate on what tag you’re specifically referring too? Can you show me a screenshot of the issue (you’ll need to temporarily disable the provided PHP)? Please note that we’re currently unable to process attachments so you’ll need to upload it to a third party image hosting site like vgy.me or Imgur.

  3. Przemysław Otulakowski 7 years, 5 months ago

    Hi!

    Code solved problem template-parts/content.php:

    <div id="page-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    	<div class="entry-thumbnail">
    		<?php hmgbrod_post_thumbnail(); ?>
    	</div>
    		
    	<div class="entry-title">
    		<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
    	</div>
    
    	<div class="entry-content">
    		<?php
    			/* translators: %s: Name of current post */
    			$content = get_the_content();
    			$string = preg_replace('/\[.*?\]/', '', $content);
    			$trimmed_content = wp_trim_words( $string, 30, NULL );
    			echo $trimmed_content;
    		?>
    	</div>
    	
    	<div class="entry-more">
    		<a href="<?php echo get_permalink(); ?>" class="arrow-more"></a>
    	</div>
    	
    	<!-- .entry-content -->
    
    </div><!-- #page-## -->

    Views
    Before:

    After:

  4. Przemysław Otulakowski 7 years, 5 months ago

    Sory, i can’t edit post

    Before
    https://imgur.com/o70UrRP

    After
    https://imgur.com/KDmFitZ

Replies on this thread are closed.

Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Have a different question or issue?

Start New Thread