marketpress - custom call to the_excerpt function

Hi

I've looked through the template-functions.php file and don't quite see what I need. If Ihave a custom query to the post_type 'products' and I want to call that products exceprt without using the_excerpt (they are all different lengths) - what would my function be?

Essentially I want the mp_product_excerpt function that will replace the WP function the_excerpt()

  • pro120
    • Design Lord, Child of Thor

    Is there a specific reason why the_excerpt won't work? From my understanding if your using a custom query you would just be creating a redundant function since products are just a custom post type.

    You could access the excerpt directly from the returned query like so.

    $query = get_posts($args);
    foreach  ( $query as $product ) {
        echo '$product->post_excerpt';
    }
  • tbennett04
    • Site Builder, Child of Zeus

    Because the excerpt length varies from product to product. Unfortunately the designer left off the product detail page and I'm having to find a way around it to give the client the desired results.

    Thanks for your suggestion - I wasn't sure since MP had its own functions and fields if it was a different call. This would work however.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.