• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED How do I add a Univerval Snippets in Widgets

debcal2

New member
Messages
3
Likes
0
Points
1
#1
Hi
I am trying to add a universal snippet in Widget, but its not showing the original code, just showing the snippets code as attached. I have tried both with Text and Custom HTML widget, but the results are same. The snippet is running OK in the page.

1.jpg

2.jpg
 

Kirill

Support team
Messages
82
Likes
4
Points
8
#2
Hello

Please put here your snippet code.
Give me screenshot of your snippet options. And screenshot of list on "Snippets" page.
What theme are you using?

Best regards
 

debcal2

New member
Messages
3
Likes
0
Points
1
#3
PHP:
<h4 style="padding-left:10px; padding-top:10px;text-align: left;">
            Select Doctor :
        </h4>

    
    <?php
$sql_d=mysql_query("select * from daradiad_pm_app.doctors where status=1") or die("Doctors : ".mysql_error());
while($row_d=mysql_fetch_array($sql_d)){
?>
        <p style="font-size:14px; color:#000000; font-weight:bold;float:left;margin: 5px 25px 5px 5px;" onClick="getName(<?=$row_d['d_id']?>)">
<?php $img=$row_d['d_image'];
if($img!=''){?>       
        <img src="http://www.learnpain.org/patient_management/uploads/<?=$row_d['d_image']?>" alt="<?=$row_d['d_name']?>" style="object-fit: cover;vertical-align: middle;width: 150px;height: 150px;border-radius: 50%;border: solid 2px #fff;-webkit-box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.25);-moz-box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.25);box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.25);">
        <?php } else{?>
<img src="img_avatar.png" alt="Avatar"  style="object-fit: cover;vertical-align: middle;width: 150px;height: 150px;border-radius: 50%;border: solid 2px #fff;-webkit-box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.25);-moz-box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.25);box-shadow: 0px 0px 8px 0px rgba(0,0,0,0.25);">
<?php } ?><br><?=strtoupper($row_d['d_name'])?></p>
<?php } ?>
 

Attachments

alexkovalev

Program developer
Staff member
Messages
267
Likes
19
Points
18
#4
Your theme may simply not support shortcodes for widgets. Please check if other shortcodes work in this widget? Try inserting shortcodes form other plugins, will this work?

Best regards, Alex
 

debcal2

New member
Messages
3
Likes
0
Points
1
#5
But its working in Pages, but not from widgets. I tried with WP Customer Reviews and its also not working. Is there any way to enable shortcodes from widgets?
 

alexkovalev

Program developer
Staff member
Messages
267
Likes
19
Points
18
#6
I think this question should be asked to the developer of your theme. You can leave here a link to the theme, so I looked at it. But it is better to create a new ticket in support of this theme, they best know how to solve this problem.

Best regards, Alex