WordPress.org

Ready to get started?Download WordPress

Forums

MarketPress - WordPress eCommerce
[resolved] Shortening Marketpress Product Titles to X amount of characters (3 posts)

  1. luke_holloway
    Member
    Posted 11 months ago #

    Hi,
    I was contacted by a client who needs the product titles of their Marketpress plugin to be shortened to some many character and then "..." after that limit is reached. This is what the code looks like before any thing is added:

    <h3 class="mp_product_name">
                          <a href="' . get_permalink($post->ID) . '">' . ($post->post_title) . '</a>
                        </h3>

    When I add the code to shorten it says error (and the page won't load as I am sure you have all experienced!). Here is the code I added:

    <h3 class="mp_product_name">
                          <a href="' . get_permalink($post->ID) . '">' . ($post->post_title,0,50) . '</a>
                        </h3>

    If you guys would give me a hand I would be grateful.

    P.S. Is there anyway I could use the substr function for php?

    http://wordpress.org/extend/plugins/wordpress-ecommerce/

  2. Mike
    WPMU DEV Support Staff
    Posted 11 months ago #

    Hi @luke_holloway

    There is a thread here where someone asked to limit characters and this poster answered the question:
    http://wordpress.org/support/topic/limit-title-to-25-characters

    Hopefully that helps, if it does please reply here with the method used and then mark as resolved so people can get to the answer quickly :-)

  3. WPMUDEV
    WPMU DEV Support Staff
    Plugin Author

    Posted 11 months ago #

    Hey there.

    We haven't heard from you in awhile, so I just wanted to check in to make sure all was good.

    This thread was marked resolved, but please, if you still need help then just respond and open it back up. We can then take it from there. :)

    Hope you have a fantastic day!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.