Здравствуйте, подскажите пожалуйста как сделать, что бы к divam с classom добавлялись уникальные id в wordpress теме?
тут создаются несколько content-block-row но без id.
// Start Block Display
if ( $column == 1 ) echo '<div class="content-block-row" >';
?>
Как сделать что бы в каждой строке добавлялся разный id?
// Start Block Display
if ( $column == 1 ) echo '<div class="content-block-row" id="" >';
?>
Вот большая часть кода
foreach( $content_blocks_query->posts as $post) :
if ( $box['page'] == $post->ID || $altPage == $post->ID ) :
// Init
setup_postdata( $post );
$visual = $visualtype = '';
$box['icon_style'] = ( isset( $box['icon_style'] ) ) ? $box['icon_style'] : 'none';
// Refresh user style (to add future op of diff styles for each block)
$style = $userstyle;
// Style-3 exceptions: doesnt work great with icons of 'None' style, or with images or with no visual at all. So revert to Style-2 for this scenario.
if ( $style == 'style3' ) {
if ( !empty( $box['icon'] ) ) {
if ( $box['icon_style'] == 'none' ) $style = 'style2';
} else $style = 'style2';
}
// Set image or icon
if ( !empty( $box['icon'] ) ) {
$visualtype = 'icon';
$visual = '<i class="fa ' . sanitize_html_class( $box['icon'] ) . '"></i>';
} elseif ( has_post_thumbnail() ) {
$visualtype = 'image';
if ( $style == 'style4' ) {
// switch ( $columns ) {
// case 1: $img_size = 2; break;
// case 2: $img_size = 4; break;
// default: $img_size = 5;
// }
$img_size = 5;
} else {
$img_size = $columns;
}
$img_size = hoot_thumbnail_size( 'column-1-' . $img_size );
$img_size = apply_filters( 'content_block_img', $img_size, $columns, $style );
$visual = 1;
}
// Set Block Class (if no visual for style 2/3, then dont highlight)
$block_class = ( !empty( $visual ) && $style == 'style3' ) ? 'highlight-typo' : 'no-highlight';
if ( !empty( $visual ) && $style == 'style2' )
$block_class = ( $userstyle == 'style3' ) ? 'highlight-typo' : 'contrast-typo';
// Set URL
if ( $box['excerpt'] === 'excerpt' && empty( $box['url'] ) ) {
$linktag = '<a href="' . get_permalink() . '" ' . hybridextend_get_attr( 'content-block-link', 'permalink' ) . '>';
$linktagend = '</a>';
} elseif ( !empty( $box['url'] ) ) {
$linktag = '<a href="' . esc_url( $box['url'] ) . '" ' . hybridextend_get_attr( 'content-block-link', 'custom' ) . '>';
$linktagend = '</a>';
} else {
$linktag = $linktagend = '';
}
// Start Block Display
if ( $column == 1 ) echo '<div class="content-block-row" id="" >';
?>
<div class="content-block-column <?php echo 'hcolumn-1-' . $columns; ?> <?php echo sanitize_html_class( 'content-block-' . $style ); ?>">
<div class="content-block <?php echo $block_class; ?>">
<?php if ( $visualtype == 'image' ) : ?>
<div class="content-block-visual content-block-image">
<?php echo $linktag;
hoot_post_thumbnail( 'content-block-img', $img_size );
echo $linktagend; ?>
</div>
<?php elseif ( $visualtype == 'icon' ) : ?>
<?php
$contrast_class = ( 'none' == $box['icon_style'] ) ? '' :
( ( 'style4' == $style ) ? ' contrast-typo ' : ' contrast-typo ' );
$contrast_class = ( 'style3' == $style ) ? ' enforce-typo ' : $contrast_class;
?>
<div class="content-block-visual content-block-icon <?php echo 'icon-style-' . esc_attr( $box['icon_style'] ); echo $contrast_class; ?>">
<?php echo $linktag . $visual . $linktagend; ?>
</div>
<?php endif; ?>