dynamisches suchfeld eingefügt - nocht

erstelle mit claude 4.5 - die auswahlfunktion funktioniert aber nicht das absenden nach dem auswählen in den beitrag hinein. -> "Block rendering failed"
This commit is contained in:
Jörg Lohrer 2025-10-01 13:25:30 +02:00
parent 9341afa1dc
commit 7437d10019
3 changed files with 161 additions and 26 deletions

View file

@ -18,9 +18,11 @@ $default_options = array(
'wrap_padding_right' => 10,
'wrap_padding_top' => 10,
'wrap_padding_bottom' => 10,
'wrap_background_color' => '#ffffff',
'wrap_border_width' => 0,
'wrap_border_color' => '#000000',
'wrap_border_radius' => 0,
'post_list_row_gap' => 0,
'image_align' => 'center',
'image_size' => 'medium',
'link_image' => '',
@ -29,14 +31,18 @@ $default_options = array(
'link_title' => '',
'title_font_size' => '24',
'title_font_align' => 'left',
'title_font_color' => '#000000',
'post_date_font_size' => '16',
'post_date_font_align' => 'left',
'show_post_date' => '',
'post_content_font_size' => '16',
'post_content_font_align' => 'left',
'post_custom_html' => '',
'post_custom_html_font_size' => '16',
'post_custom_html_font_align' => 'left',
'post_custom_html_font_color' => '#000000',
'show_content' => 'excerpt',
'excerpt_length' => '',
'hide_button' => '',
'button_text' => 'Read more',
'button_text_font_size' => '16',
@ -44,6 +50,7 @@ $default_options = array(
'button_text_color' => '#ffffff',
'button_border_radius' => '3',
'button_align' => 'left',
'button_width' => 'inline',
'block_padding_left'=>15,
'block_padding_right'=>15,
'block_padding_top' => 20,
@ -53,6 +60,11 @@ $default_options = array(
$options = array_merge($default_options, $options);
// Ensure composer variable is available for style functions
if (!isset($composer)) {
$composer = array();
}
$title_style = TNP_Composer::get_title_style($options, 'title', $composer);
$post_date_style = TNP_Composer::get_title_style($options, 'post_date', $composer);
$post_content_style = TNP_Composer::get_title_style($options, 'post_content', $composer);
@ -73,7 +85,9 @@ $post_custom_html_style = TNP_Composer::get_style($options, 'post_custom_html',
border-radius: <?php echo esc_attr( $options['wrap_border_radius'] ); ?>px;
}
.post-row {
padding-bottom: <?php echo esc_attr( $options['post_list_row_gap'] ); ?>px;
<?php if( !empty($options['post_list_row_gap']) ){ ?>
padding-bottom: <?php echo esc_attr( $options['post_list_row_gap'] ); ?>px;
<?php } ?>
}
.featured-image-wrap {
text-align: <?php echo esc_attr( $options['image_align'] ); ?>;
@ -86,37 +100,37 @@ $post_custom_html_style = TNP_Composer::get_style($options, 'post_custom_html',
border-radius: <?php echo esc_attr( $options['border_radius'] ); ?>px;
}
.title {
<?php esc_html( $title_style->echo_css() ) ?>
<?php echo $title_style->echo_css() ?>
line-height: normal;
margin: 0 !important;
padding-top: 10px;
padding-bottom: 10px;
}
.title-link {
<?php esc_html( $title_style->echo_css() ) ?>
<?php echo $title_style->echo_css() ?>
line-height: normal;
margin: 0 !important;
padding-top: 10px;
padding-bottom: 10px;
<?php if( $options['title_font_color'] ){ ?>
<?php if( !empty($options['title_font_color']) ){ ?>
color: <?php echo esc_attr( $options['title_font_color'] ); ?>;
<?php } ?>
}
.post-date {
<?php esc_html( $post_date_style->echo_css() ) ?>
<?php echo $post_date_style->echo_css() ?>
margin: 0 !important;
padding-top: 10px;
padding-bottom: 10px;
}
.post-excerpt {
<?php esc_html( $post_content_style->echo_css() ) ?>
<?php echo $post_content_style->echo_css() ?>
line-height: 1.4em;
margin: 0 !important;
padding-top: 10px;
padding-bottom: 10px;
}
.post-full {
<?php esc_html( $post_content_style->echo_css() ) ?>
<?php echo $post_content_style->echo_css() ?>
line-height: normal;
margin: 0 !important;
padding-top: 10px;
@ -124,7 +138,7 @@ $post_custom_html_style = TNP_Composer::get_style($options, 'post_custom_html',
}
.post-custom-html {
mso-line-height-rule: exactly;
<?php echo esc_html( $post_custom_html_style->echo_css() ) ?>
<?php echo $post_custom_html_style->echo_css() ?>
line-height: normal;
margin: 0 !important;
padding-top: 10px;
@ -137,20 +151,20 @@ $post_custom_html_style = TNP_Composer::get_style($options, 'post_custom_html',
text-align: <?php echo esc_attr( $options['button_align'] ); ?>;
}
.post-button {
<?php echo esc_html( $text_style->echo_css() ) ?>
<?php echo esc_html( $button_text_style->echo_css() ) ?>
<?php echo $text_style->echo_css() ?>
<?php echo $button_text_style->echo_css() ?>
background: <?php echo esc_attr( $options['button_color'] ); ?>;
color: <?php echo esc_attr( $options['button_text_color'] ); ?>;
display: inline-block;
<?php if( $options['button_width'] == 'full_width' ){ ?>
<?php if( !empty($options['button_width']) && $options['button_width'] == 'full_width' ){ ?>
display: block;
<?php } ?>
padding: 12px 24px;
<?php if( $options['button_text_font_size'] ){ ?>
<?php if( !empty($options['button_text_font_size']) ){ ?>
padding: <?php echo esc_attr( $options['button_text_font_size'] ) * 0.5; ?>px <?php echo esc_attr( $options['button_text_font_size'] ) * 1; ?>px;
<?php } ?>
text-decoration: none;
<?php if( $options['button_border_radius'] ){ ?>
<?php if( !empty($options['button_border_radius']) ){ ?>
border-radius: <?php echo esc_attr( $options['button_border_radius'] ); ?>px;
<?php } ?>
}
@ -175,11 +189,14 @@ $post_custom_html_style = TNP_Composer::get_style($options, 'post_custom_html',
<tr>
<td width="100%" valign="top" align="left" class="post-row" inline-class="post-row">
<?php if($options['image_size'] != 'none'){ ?>
<div inline-class="featured-image-wrap">
<?php if( $options['link_image'] == 1 ){ echo '<a href="' . esc_url( get_the_permalink($post->ID) ) . '" inline-class="featured-image-link">'; } ?>
<img src="<?php echo esc_url( get_the_post_thumbnail_url( $post->ID, $options['image_size'] ) ); ?>" inline-class="featured-image" />
<?php if($options['link_image'] == 1){ echo '</a>'; } ?>
</div>
<?php $featured_image_url = get_the_post_thumbnail_url( $post->ID, $options['image_size'] ); ?>
<?php if( $featured_image_url ){ ?>
<div inline-class="featured-image-wrap">
<?php if( $options['link_image'] == 1 ){ echo '<a href="' . esc_url( get_the_permalink($post->ID) ) . '" inline-class="featured-image-link">'; } ?>
<img src="<?php echo esc_url( $featured_image_url ); ?>" inline-class="featured-image" />
<?php if($options['link_image'] == 1){ echo '</a>'; } ?>
</div>
<?php } ?>
<?php } ?>
<?php if($options['hide_title'] != 1){ ?>
<p inline-class="title">