• indest

    (@indest)


    OK, so I’ll try to be brief.

    I like to link my comments to threads on mybb. However, there is no current plugins that meet my need (yes I have tried wordbb, pressbb, ect). Hence, I want to edit my theme to include the following:

    I would like to type <–commentsmybb–url–> into a blog post and have a button (linking to the url) appear next the the read more link on my FP.

    Is there a simple way to make this or something similar? May someone help me with the code please?

    Thanks in advance,
    Mike

Viewing 4 replies - 1 through 4 (of 4 total)
  • MeRuud

    (@meruud)

    I’m a bit confused on what you actually want, and I am not very familiar with “mybb”.

    But I assume every post will have its own discussion page?
    What you could do is create a metabox:

    $prefix = 'wtf_';
    $page = array('post');
    
    $meta_box = array(
    	'id' => 'themename',
    	'title' => 'mybb Link',
    	'context' => 'normal',
    	'priority' => 'high',
    	'fields' => array(
    		array(
    			'name' => 'mybb Link',
    			'desc' => 'mybb Link',
    			'id' => $prefix . 'mybb',
    			'type' => 'text',
    			'std' => ''
    		),
    	),
    
    );

    So you can add a url to every post / page.

    Then call the metabox data in your theme, wherever you want to display it.

    $mybb = get_post_meta($post->ID, 'wtf_mybb', true);
    <?php if ($mybb){ ?>
    			<a href="<?php echo stripslashes ($mybb); ?>" target="_blank">myBB discussion</a>
    		<?php } ?>

    That should do it (haven’t tested it, so let me know if it works).

    Thread Starter indest

    (@indest)

    Sweet, I’ll give this a shot soon.

    Essentially, I want to add a unique url to each post and have the link next to the read more button.

    Hopefully this works, thanks.

    MeRuud

    (@meruud)

    Yeah the above should fullfil your needs.

    Here are two tutorials, explaining it all very well:
    http://www.farinspace.com/how-to-create-custom-wordpress-meta-box/
    http://www.deluxeblogtips.com/2010/04/how-to-create-meta-box-wordpress-post.html

    Thread Starter indest

    (@indest)

    nvm

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to make a button similar to the Read More’ is closed to new replies.