Jump to content

[WordPress] PHP shortcode editing help


Bigsease30

Recommended Posts

Hello Everyone! I am new here. I have visited this site many times before for info but haven't joined until now. I now find myself with a problem that I can not figure out on my own. I purchased a wordpress template and it come pre-loaded with many useful shortcodes. One of which caught my eye but I can seem to get the code for it to look the way I want it to. Hense why I am here with the pros asking for help. I will try to post as much detail as possible in the text below to help you assist me in this project.

 

The short code in wordpress is this:

[callout title="Visit Our Patient Portal" button="Patient Registration" link="http://google.com" buttoncolor="green" target="_blank" buttonmargin="4px 0 0 0;"]Very user friendly and easy to use![/callout]

 

This entered looks like this on the home page:

10_zps2ad1aca1.jpg

 

The callout code in the shortcode.php file looks like this:

function minti_callout( $atts, $content = null) {
extract( shortcode_atts( array(
 'title' => '',
 'button' => '',
 'buttonsize' => 'normal',
 'buttoncolor' => 'alternative-1',
 'link' => '',
 'target' => '_self',
 'buttonmargin' => '0px'
 ), $atts ) );
 return '<div class="callout"><div class="border clearfix"><div class="callout-content">
	 <h2 class="highlight">' .$title. '</h2>' . do_shortcode($content) . '
	 </div><div class="callout-button" style="margin:' .$buttonmargin. ';">
	 <a class="button ' .$buttonsize. ' ' .$buttoncolor. '" href="' .$link. '" target="' .$target. '">' .$button. '</a>
	 </div></div></div>';
}
function minti_box( $atts, $content = null) {
extract( shortcode_atts( array(
 'style' => '1'
 ), $atts ) );
 return '<div class="description clearfix style-' .$style. '">' . do_shortcode($content) . '</div>';
}

 

I am trying to add two more buttons for a total of three using the short code but this is my downfall. I want it to look like this:

need_zpsb22178dc.jpg

 

If you think that you can help, Please post here and let me know. I have been working on this for 3 days straight and I can't get it to work. I wish PHP was as easy as Photoshop.

 

Thanks in advance,

Bigsease30

Edited by KevinM1
Link to comment
Share on other sites

Do you know PHP? If so, What have you tried?

If not, I recommend our freelance forum.

 

I dont know php very well but I found a few exaples online. However, the php code that I find online doesnt look like the above code at all. If I dont het help here in the forums I will move over to the freelance forum.

 

The reason that I chose to use wordpress is so that I would have to do minimal html and php changes.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.