enter image description here

I Have wordpress site. I want to change icons of the blocks with my png images but I cant because it needs something to change in functions php.

How is it:

How I want to be:

enter image description here

PHP code:

<?php
$home_blocks = $tugdmedia['home_sort_id'];
if ($home_blocks):
foreach ($home_blocks as $key=>$value) {
    switch($key) {
    //Blocks
    case 'blocks': ?>
    <div class="home_blocks ast_blocks"><?php get_template_part('frontpage/content','blocks'); ?></div>

Functions code:

$sections[] = array(
    'type' => 'divide',
);
$sections[] = array(
    'icon' => 'home-alt',
    'icon_class' => 'icon-large',
    'title' => __('Front Page ', 'tugdmedia'),
    'fields' => array(
        array(
            'id'=>'block1_text_id',
            'type' => 'text',
            'title' => __('Block 1 Title', 'tugdmedia'),
            'default' => 'Lorem Ipsum'
            ),  
        array(
            'id'=>'block1_icon',
            'type' => 'select',
            'title' => __('Block 1 Icon', 'tugdmedia'), 
            'data' => 'elusive',//Must provide key => value pairs for select options
            'default' => 'fa-camera'
            ),
        array(
            'id'=>'block1_link_id',
            'type' => 'text',
            'title' => __('Block 1 Link', 'tugdmedia')
            ),
        array(
            'id'=>'block1_textarea_id',
            'type' => 'editor',
            'title' => __('Block 1 Content', 'tugdmedia'), 
            'default' => 'Lorem ipsum dolor sit amet, consectetur  dol adipiscing elit. Nam nec rhoncus risus. In ultrices lacinia ipsum, posuere faucibus velit bibe.',
            ),
        array(
            'id'=>'block2_text_id',
            'type' => 'text',
            'title' => __('Block 2 Title', 'tugdmedia'),
            'default' => 'Lorem Ipsum'
            ),  
        array(
            'id'=>'block2_icon',
            'type' => 'select',
            'title' => __('Block 2 Icon', 'tugdmedia'), 
            'data' => 'elusive',//Must provide key => value pairs for select options
            'default' => 'fa-rocket'
            ),
        array(
            'id'=>'block2_link_id',
            'type' => 'text',
            'title' => __('Block 2 Link', 'tugdmedia')
            ),
        array(
            'id'=>'block2_textarea_id',
            'type' => 'editor',
            'title' => __('Block 2 Content', 'tugdmedia'), 
            'default' => 'Lorem ipsum dolor sit amet, consectetur  dol adipiscing elit. Nam nec rhoncus risus. In ultrices lacinia ipsum, posuere faucibus velit bibe.',
            ),
        array(
            'id'=>'block3_text_id',
            'type' => 'text',
            'title' => __('Block 3 Title', 'tugdmedia'),
            'default' => 'Lorem Ipsum'
            ),  
        array(
            'id'=>'block3_icon',
            'type' => 'select',
            'title' => __('Block 3 Icon', 'tugdmedia'), 
            'data' => 'elusive',//Must provide key => value pairs for select options
            'default' => 'fa-signal'
            ),
        array(
            'id'=>'block3_link_id',
            'type' => 'text',
            'title' => __('Block 3 Link', 'tugdmedia')
            ),
        array(
            'id'=>'block3_textarea_id',
            'type' => 'editor',
            'title' => __('Block 3 Content', 'tugdmedia'), 
            'default' => 'Lorem ipsum dolor sit amet, consectetur  dol adipiscing elit. Nam nec rhoncus risus. In ultrices lacinia ipsum, posuere faucibus velit bibe.',
            ),
        array(
            'id'=>'block4_text_id',
            'type' => 'text',
            'title' => __('Block 4 Title', 'tugdmedia'),
            'default' => 'Lorem Ipsum'
            ),  
        array(
            'id'=>'block4_icon',
            'type' => 'select',
            'title' => __('Block 4 Icon', 'tugdmedia'), 
            'data' => 'elusive',
            'default' => 'fa-cogs'
            ),
        array(
            'id'=>'block4_link_id',
            'type' => 'text',
            'title' => __('Block 4 Link', 'tugdmedia')
            ),
        array(
            'id'=>'block4_textarea_id',
            'type' => 'editor',
            'title' => __('Block 4 Content', 'tugdmedia'), 
            'default' => 'Lorem ipsum dolor sit amet, consectetur  dol adipiscing elit. Nam nec rhoncus risus. In ultrices lacinia ipsum, posuere faucibus velit bibe.',
            ),
        array(
            'id'=>'welcm_textarea_id',
            'type' => 'editor',
            'title' => __('Welcome Text', 'tugdmedia'), 
            'default' => '<h2>Lorem ipsum dolor sit amet, consectetur  dol adipiscing elit. Nam nec rhoncus risus. In ultrices lacinia ipsum, posuere faucibus velit bibe.</h2>',
            ),
        array(
            'id'=>'welcome_color_id',
            'type' => 'color',
            'title' => __('Background Color ', 'tugdmedia'), 
            'default' => '#333333',
            'validate' => 'color',
            ),
        array(
            'id'=>'posts_title_id',
            'type' => 'editor',
            'title' => __('Title & Description', 'tugdmedia'), 
            'default' => '<h2 style="text-align: center;"><span style="color: #e2341d;">Check Out Our Portfolio</span></h2><p style="text-align: center;">The Very recent work for our clients</p>',
            ),
        array(
            'id'=>'front_layout_id',
            'type' => 'image_select',
            'compiler'=>true,
            'title' => __('Posts layout', 'tugdmedia'), 
            'options' => array(
                    '1' => array('alt' => 'Layout 1', 'img' => get_template_directory_uri().'/images/layout1.png'),
                ),
            'default' => '1'
            ),
        array(
            'id'=>'enable_cat',
            'type' => 'switch', 
            'title' => __('Display posts from selected Categories', 'tugdmedia'),
            "default"       => 0,
            ),
        array(
            'id'=>'posts_cat_id',
            'type' => 'select',
            'data' => 'categories',
            'multi' => true,
            'title' => __('Category Names', 'tugdmedia'), 
            ),  
        array(
            'id'=>'n_posts_field_id',
            'type' => 'text',
            'title' => __('Number of Posts ', 'tugdmedia'),
            'default' => '9',
            ),
        array(
            'id'=>'map-info',
            'type' => 'info',
            'desc' => __("This feature is only available in tugdmedia PRO", "tugdmedia"),
            ),
        array(
            'id'=>'callaction-info',
            'type' => 'info',
            'desc' => __("This feature is only available in tugdmedia PRO", "tugdmedia"),
            ),
        array(
            'id'=>'widget-info',
            'type' => 'info',
            'desc' => __("This feature is only available in tugdmedia PRO", "tugdmedia"),
            ),
        array(
            'id' => 'home_sort_id',
            'type' => 'sortable',
            'mode' => 'checkbox', // checkbox or text
            'title' => __('Frontpage Elements position', 'tugdmedia'),
            'desc' => __('Drag and Drop each element to reorder their position.', 'tugdmedia'),
            'options' => array(
                'blocks' => 'Blocks',
                'welcome-text' => 'Welcome Text',
                'posts' => 'Frontpage Posts'
                ),
            'default' => array(
                'blocks' => 'Blocks',
                'welcome-text' => 'Welcome Text',
                'posts' => 'Frontpage Posts'
                )
            ),
    )
);

If anything more needed for information I’ll answer imediately. By the way you can see my website with your own: enter link description here

Read more here: WordPress: change icons with png images [into functions]


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , ,

Wordpress related questions and answers: