Zend certified PHP/Magento developer

Issue with get product attribute value in other place than list.phtml

Currently via below code I can get in list.phtml

From this I get brand name dropdown value in list.phtml correct:

<div class="brand-name"> <?php 
            $optionText = '';
            $attr = $_product->getResource()->getAttribute('brand');

            if ($attr->usesSource()) {
               $optionText = $attr->getSource()->getOptionText($_product->getBrand());
            }
            ?>
            <?php if($optionText){ ?>
                 <?php echo "" . $optionText . "<br>"; ?>
            <?php } ?></div>

via this code I get text subname in list.phtml

<div class="subname">
                        <?php /* @escapeNotVerified */ echo $_product->getResource()->getAttribute('subname')->getFrontend()->getValue($_product); ?><?php /* @escapeNotVerified */ echo __('<br /><br />') ?></div>
                            

Now I try also display this attributes in custom slider:

app/code/Mageplaza/Productslider/view/frontend/templates/productslider.phtml 

But When I put this code then sliders dissapper. I try add variable to this file:

<?php
$_productCollection = $block->getLoadedProductCollection();
$_helper = $this->helper('MagentoCatalogHelperOutput');
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$productModel = $objectManager->get('MagentoCatalogModelProduct');
?>

But still no work. Can anyone help me?

This file mageplaza slider file:
https://github.com/mageplaza/magento-2-product-slider/blob/2.4/view/frontend/templates/productslider.phtml