<?php
add_action("init","goldy_nature_hook",12);
?>
<?php
function goldy_nature_hook(){
                 
	remove_action('goldy_our_portfolio_loop', 'goldy_mex_our_portfolio_loop', 5);

add_action('goldy_our_portfolio_loop', 'goldy_new_design_our_portfolio_loop', 5);
function goldy_new_design_our_portfolio_loop($info_item) {
?>
    <div class="new-portfolio-item-wrapper">
        <div class="new-portfolio-item">
            <div class="new-portfolio-image-wrapper">
                <?php if (!empty($info_item['image'])) { ?>
                    <img src="<?php echo esc_url($info_item['image']); ?>" alt="<?php echo esc_html($info_item['title']); ?>" class="new-portfolio-image">
                <?php } else { ?>
                    <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/no-thumb.jpg" alt="<?php _e('No Thumbnail', 'goldy-nature'); ?>" class="new-portfolio-image"> 
                <?php } ?>
            </div>
            <div class="new-portfolio-content">
                <h3 class="new-portfolio-title"><?php echo esc_html($info_item['title']); ?></h3>
                <div class="new-portfolio-description">
                    <p><?php echo wp_kses_post($info_item['text']); ?></p>
                </div>
                <?php if (!empty($info_item['link_url'])) { ?>
                    <div class="new-portfolio-button">
                        <a href="<?php echo esc_url($info_item['link_url']); ?>" class="new-portfolio-read-more">
                            <?php _e('Read More', 'goldy-nature'); ?> <i class="fa fa-arrow-right"></i>
                        </a>
                    </div>
                <?php } ?>
            </div>
        </div>
    </div>
<?php
}

// Remove old testimonial loop
remove_action('goldy_our_testimonial_loop', 'goldy_mex_our_testimonial_loop', 5);

// Add new testimonial loop
add_action('goldy_our_testimonial_loop', 'goldy_nature_our_testimonial_loop', 5);

function goldy_nature_our_testimonial_loop($info_item) {
?>
    <div class="modern-testimonial-card">
        <div class="testimonial-top">
            <div class="testimonial-image">
                <?php if (!empty($info_item['image'])): ?>
                    <img src="<?php echo esc_url($info_item['image']); ?>" alt="<?php _e('Testimonial Image', 'goldy-nature'); ?>">
                <?php else: ?>
                    <img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/no-thumb.jpg" alt="<?php _e('Default Image', 'goldy-nature'); ?>">
                <?php endif; ?>
            </div>
            <div class="testimonial-info">
                <h3 class="testimonial-name"><?php echo esc_html($info_item['title']); ?></h3>
                <span class="testimonial-role"><?php echo esc_html($info_item['subtitle']); ?></span>
            </div>
        </div>
        <div class="testimonial-quote">
            <p><?php echo wp_kses_post($info_item['text']); ?></p>
        </div>
    </div>
<?php
}

}

