themes - Add fields to edit in custom widget

admin2025-06-03  4

I'm coding my first theme. I want to have class event editable in Admin Panel as a widget. I don't know how to declare this widget in functions.php to keep my hierarchy and class names.

<div class="event">
<h2><i class="far fa-calendar-check"></i> Wydarzenia</h2>
<p><span class="date">7 lutego 2019 </span>Wywiadówka godzina 17.00</p>
</div>

In functions.php:

$args = array(
'name' => "Event",
'before_widget' => '<div class="event">',
'after_widget' => "</div>\n",
'before_title' => '<h2><i class="far fa-calendar-check"></i> ', 
'after_title' => "</h2>\n",
);
register_sidebar($args);

I don't know how to put P and SPAN inside and make it editable but if it wasn't possible, could you tell me how to do it? I want an effect like on the pic, but it's coded manually and is not editable in Admin Panel

Here, I want to have '7 lutego 2019' as individual input like Title.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748897749a314638.html

最新回复(0)