WordPress.org

Ready to get started?Download WordPress

Forums

MyBB Cross-Postalicious
[resolved] The default content of cross posts (have post feature image/thumbnail included) (4 posts)

  1. a_ahmed
    Member
    Posted 1 year ago #

    How would I do this?

    I have

    !BEGINLINK!!TITLE!!ENDLINK!

    Discuss the above published news/article bellow:

    However I'd like to also add before the begin link the post feature image/thumbnail.

    Could you help out?

    http://wordpress.org/extend/plugins/mybb-cross-postalicious/

  2. a_ahmed
    Member
    Posted 1 year ago #

    Well I couldn't wait for slow support on here.

    I just implemented this myself

    // parse postlink and title
    		$cross_post_title = preg_replace('/!TITLE!/', $post->post_title, $cross_post_title);
    		$cross_post_content = preg_replace('/!IMAGE!/', '[img]' . wp_get_attachment_url(get_post_thumbnail_id($post->ID)) . '[/img]', $cross_post_content);
    		$cross_post_content = preg_replace('/!BEGINLINK!(.*)!ENDLINK!/', '[url=' . $post->guid . ']$1[/url]', $cross_post_content);
    		$cross_post_content = preg_replace('/!TITLE!/', $post->post_title, $cross_post_content);

    Notice my addition. !IMAGE! is now replaced with the post thumbnail

    You just have to fiddle with the settings

    So in my case when I post I now have:

    !BEGINLINK!!TITLE!!ENDLINK!
    !IMAGE!

    Discuss the above published news/article bellow:

    ;)

  3. mechter
    Member
    Plugin Author

    Posted 1 year ago #

    This is how you do it.

  4. kokoko420
    Member
    Posted 1 year ago #

    where you paste above coding let me know please

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic