Hi Ajay! hope you are doing well today.
Look up this little function:
function ajay_shortcode( $atts ) {
$a = shortcode_atts( array(
'background' => ''
), $atts );
$bg = ( "{$a['background']}" != "" ) ? "{$a['background']}" : "#000" ;
ob_start();
?>
<div style="background:<?php echo $bg; ?>;">
this is a division
</div>
<?php
return ob_get_clean();
}
add_shortcode("ajay", "ajay_shortcode");
// test-use [ajay background="red"]
echo do_shortcode('[ajay background="red"]');
Hey Samual, thanks for your response.. my issue is i have added shortcode button in tinymce & on click it gives option to add attribute contents to user in that area for color option i want to show color picker..
Another thing i sent an email about weeks before but i have not received your response yet..
Ajay
Hey Ajay!
Can you use pastebin.com to paste us the code you use for both adding tool to TinyMCE and shortcode function? thanks!
Oh, I thought you didn’t see my reply, well, I replied to your email the day after you have sent it. If you don’t find that email, let me know so I’ll forward it to you again 😉
Just found your email sending you reply with access to my code.
Thanks
Ajay
Hi Ajay,
Just letting you know that yet I haven’t received anything on my email.
🙂
Hi Samuel,
Just sent email please check again.
Ajay