[Resolved] How to show own excerpt ?

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support How to show own excerpt ?

Tagged: ,

This topic contains 20 replies, has 2 voices, and was last updated by  Tom 2 years, 6 months ago.

Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #276

    Jamal
    Participant

    I’m not sure if i understood correctly but i wanted to show you what i have when i remove the CSS to hide the read more tag. Did you mean the “Find out more” should not be shown in this case?

    If i wanted to show this instead of the excerpt how would i go about it? Do i need to edit the theme’s single.php at all or is it enough with wsps hooks? If yes, do i need to chage anything in this part of the hook?

        $meta = get_post_meta( get_the_ID(), '_your_custom_meta_key', true );
        if ( isset( $meta ) && '' !== $meta )
            echo $meta;

    Sorry if its beyond the scope of the plugin support,im unable to get my head round it and will appreciate a little guide. Thanks !

    #278

    Tom
    Keymaster

    If that “Find out more…” link is being added correctly by the theme, it should no longer show up if you’re using the latest version of WPSP.

    Hmm, showing something like that with HTML instead of the text would be quite difficult.. Would every post have a custom excerpt like that or only a couple?

    #283

    Jamal
    Participant

    Im using the latest version of WPSP and this is how they seem to be adding the “find out more …” link http://pastebin.com/c8UfkHUH

    What i wanted to show seems to be a post meta displayed using this https://raw.githubusercontent.com/wiredimpact/wired-impact-volunteer-management/master/templates/opp-single-meta.php

    Would really appreciate any help. Thanks

    #287

    Tom
    Keymaster

    Hmm, you could try wrapping the above PHP in a function and hooking it into WPSP.

    Something like this:

    add_action( 'wpsp_before_content','wpsp_add_custom_meta' );
    function wpsp_add_custom_meta()
    {
        $opp = new WI_Volunteer_Management_Opportunity( get_the_ID() );
        ?>
    
        <div class="volunteer-opp-info">
    	<?php $opp->display_meta( ( $opp->opp_meta['one_time_opp'] == 1 ) ? $opp->format_opp_times() : $opp->opp_meta['flexible_frequency'], __( 'When:', 'wired-impact-volunteer-management' ) ); ?>
    	<?php $opp->display_meta( $opp->format_address(), 										__( 'Where:', 'wired-impact-volunteer-management' ) ); ?>
    
    	<?php $opp->display_meta( $opp->opp_meta['contact_name'], 								__( 'Contact:', 'wired-impact-volunteer-management' ) ); ?>
    	<?php $opp->display_meta( $opp->get_email_as_link( $opp->opp_meta['contact_email'] ), 	__( 'Contact Email:', 'wired-impact-volunteer-management' ) ); ?>
    	<?php $opp->display_meta( $opp->opp_meta['contact_formatted_phone'], 					__( 'Contact Phone:', 'wired-impact-volunteer-management' ) ); ?>
    
    	<?php $opp->display_meta( $opp->get_open_volunteer_spots(), 							__( 'Open Volunteer Spots:', 'wired-impact-volunteer-management' ) ); ?>
        </div><!-- .volunteer-opp-info -->
        <?php
    }

    Not sure if it will work or not, but worth a shot.

    #301

    Jamal
    Participant

    Tom, you are a genius ! Thank you very much for helping out, i don’t have enough words to express my gratitude.

    #303

    Tom
    Keymaster

    Glad I could help! 🙂

Viewing 6 posts - 16 through 21 (of 21 total)

You must be logged in to reply to this topic.