WordPress.org

Support

Support » Plugins and Hacks » MarketPress - WordPress eCommerce » [Resolved] Shortening Marketpress Product Titles to X amount of characters

[Resolved] Shortening Marketpress Product Titles to X amount of characters

  • 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/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Shortening Marketpress Product Titles to X amount of characters’ is closed to new replies.
Skip to toolbar