class WP_Widget – Different dashboard preview for custom widget

Question

I try to create custom widget to display specified category latest-posts on home page.
Unfortunately outcome of my php code print a lot of html elements so on dashboard widgets page the preview is unneccessary huge. For example it display a featured images of listed posts.

Is there any solution to have different preview of my widget on dashboard in contrast to what my widget show on home page?

I tried in my php use is_admin() function but it does not work.

0
X9DESIGN 2 months 2022-09-27T00:56:50-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse