is there a way for me to remove the extra

Hi, is there a way for me to remove the extra <p> in between the excerpt and the Choose Options button in Marketpress - on this page: http://nzhart.com/store/products/
I'd like people to see the buttons without scrolling down.

Also,... is there a way to delete the "..." that's automatically appended to the end of the excerpt.

  • Rupok

    Hi Robert

    Hope you had a wonderful day.

    is there a way for me to remove the extra <p> in between the excerpt and the Choose Options button

    You can do this with jQuery by crating a MU Plugin. For creating a mu plugin, create a folder named "mu-plugins" inside your "wp-content" folder. Then inside that "mu-plugins" folder, create a file with any name and with a .php extension. Now paste the code inside that file and save.

    <?php
    function trim_excerpt($text) {
      return rtrim($text,'[...]');
    }
    add_filter('get_the_excerpt', 'trim_excerpt');
    add_action( 'wp_footer', 'show_space_above' );
    function show_space_above() {
        ?>
        <script type="text/javascript">
          jQuery('p').each(function() {
    		    var $this = jQuery(this);
    		    if($this.html().replace(/\s| /g, '').length == 0)
    		        $this.remove();
    		});
        </script>
        <?php
    }

    It should also delete the " ... " part at the end of excerpt.

    For getting more idea on mu plugins, you can go through this article: https://premium.wpmudev.org/manuals/wpmu-manual-2/using-mu-plugins/

    I'd like people to see the buttons without scrolling down

    Well, you will need some custom CSS too then. Use the following custom CSS Code:

    .mp_product_meta {
      height: auto !important;
    }

    You can add this to a theme's stylesheet, in a child theme, or using a plugin like My Custom CSS.

    Have a nice day. Cheers!

  • Robert

    Rupok,

    Thank you so much for your help!
    I figured out how to add the php file via FTP!
    Unfortunately it has not fixed my issue yet.

    I think it shortened the gap between the excerpt and the Choose Options a bit, but there's still a pretty big gap in between.

    The "..." is still not removed, I think because it is not part of the excerpt,... looks like Marketpress automatically appended the "..." to the end of the excerpt.

    Any other suggestions?

    I haven't tried the custom css yet.

    Regards,

    Robert

  • Nithin

    Hi Robert,

    Hope you are doing good today. :slight_smile:

    The "..." is still not removed, I think because it is not part of the excerpt,... looks like Marketpress automatically appended the "..." to the end of the excerpt.

    function mp_change_excerpt( $more ) {
    
    	return '';
    
    }
    add_filter( 'mp_excerpt_more', 'mp_change_excerpt' );

    Can you please try this code and see whether it works, you can add this function in your mu-plugins/ folder as directed above or in your child theme's functions.php file.

    I think it shortened the gap between the excerpt and the Choose Options a bit, but there's still a pretty big gap in between.

    You could try adding a height to the above css, it's not the recommend way but should fit to your needs.

    .mp_product_meta {
      height: 260px !important;
    }

    I hope this helps. Have a nice day. :slight_smile:

    Kind Regards,
    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.