Edit File: post-3.php
<?php defined( 'ABSPATH' ) || exit; // Exit directly $metabox_options = get_post_meta( get_the_ID(), 'orun_post_opt', true ); $view = get_post_meta( get_the_ID(), 'post_views_count', true ); ?> <?php if (!empty($metabox_options['orun-meta-opt-primary-category'])) { $primarycat = get_term($metabox_options['orun-meta-opt-primary-category']); $term_id = $primarycat->term_id; } else { $categories = get_the_category(); if (!empty($categories)) { $term_id = $categories[0]->term_id; } } $bg_color = '#000'; $text_color = '#fff'; if (isset($term_id)) { global $wpdb; $table_name = $wpdb->prefix . 'termmeta'; $bg_color_meta_key = 'bg_color'; $bg_color_value = $wpdb->get_var($wpdb->prepare("SELECT meta_value FROM $table_name WHERE term_id = %d AND meta_key = %s", $term_id, $bg_color_meta_key)); if ($bg_color_value) { $bg_color = $bg_color_value; } } ?> $bg_color = '#000'; $border_color = '#000'; $border_text_color = '#000'; $text_color = '#fff'; if (isset($term_id)) { global $wpdb; $table_name = $wpdb->prefix . 'termmeta'; $bg_color_meta_key = 'bg_color'; $border_color_meta_key = 'border_color'; $text_color_meta_key = 'color'; $bg_color_value = $wpdb->get_var($wpdb->prepare("SELECT meta_value FROM $table_name WHERE term_id = %d AND meta_key = %s", $term_id, $bg_color_meta_key)); $border_color_value = $wpdb->get_var($wpdb->prepare("SELECT meta_value FROM $table_name WHERE term_id = %d AND meta_key = %s", $term_id, $bg_color_meta_key)); $text_color_value = $wpdb->get_var($wpdb->prepare("SELECT meta_value FROM $table_name WHERE term_id = %d AND meta_key = %s", $term_id, $text_color_meta_key)); $border_text_color_value = $wpdb->get_var($wpdb->prepare("SELECT meta_value FROM $table_name WHERE term_id = %d AND meta_key = %s", $term_id, $text_color_meta_key)); if ($bg_color_value) { $bg_color = $bg_color_value; } if ($border_color_value) { $border_color = $border_color_value; } if ($border_text_color_value) { $border_text_color = $border_text_color_value; } if ($text_color_value) { $text_color = $text_color_value; } } ?> <div class="orun-pm-item orun-col-p50-fw"> <div class="orun-pm-img orun-col-p40"> <a class="post-thumbnail" rel="nofollow" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> <?php if (has_post_thumbnail()) { the_post_thumbnail('orun-md', array( 'alt' => the_title_attribute(array( 'echo' => false, )), )); } else { echo '<img src="' . get_template_directory_uri() . '/assets/img/nothumb.jpg" alt="No Thumbnail" width="390" height="220">'; } ?> </a> </div> <div class="orun-pm-text orun-col-p60"> <a style="color: <?php echo $text_color; ?> !important; background-color: <?php echo $bg_color; ?> !important;" rel="nofollow" href="<?php if (!empty($metabox_options['orun-meta-opt-primary-category'])) { $primarycat = get_term( $metabox_options['orun-meta-opt-primary-category'] ); echo esc_url(get_category_link($primarycat->term_id)); } else { $categories = get_the_category(); if (!empty($categories)) { echo esc_url(get_category_link($categories[0]->term_id)); } } ?>" class="orun-pm-cat"><span><?php if (!empty($metabox_options['orun-meta-opt-primary-category'])) { $primarycat = get_term($metabox_options['orun-meta-opt-primary-category']); echo $primarycat->name; } else { $categories = get_the_category(); if (!empty($categories)) { echo $categories[0]->name; } } ?></span> </a> <h3 class="post-title"><a rel="nofollow" href="<?php echo the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> </h3> <div class="orun-pm-excerpt ocd-none xs-d-none fwd-none"> <?php if ( !empty($metabox_options['orun-meta-opt-summary']) ) { echo '<p>' . $metabox_options['orun-meta-opt-summary'] . '</pre>'; }else{ the_excerpt(); } ?> </div> <div class="orun-pm-button"> <a style="color: <?php echo $border_color; ?>; border-color: <?php echo $border_color; ?>;" rel="nofollow" href="<?php if (!empty($metabox_options['orun-meta-opt-primary-category'])) { $primarycat = get_term( $metabox_options['orun-meta-opt-primary-category'] ); echo esc_url(get_category_link($primarycat->term_id)); } else { $categories = get_the_category(); if (!empty($categories)) { echo esc_url(get_category_link($categories[0]->term_id)); } } ?>" class="orun-pm-cat-button "> <span> Devamını Oku </span> </a> <style> .custom-hover-bg { transition: all 0.3s ease; text-decoration: none; background-color: transparent; } .custom-hover-bg:hover { color: #fff; background-color: <?php echo $text_color; ?>; } </style> </div> </div> </div>