WordPress text widget with text from post for each category woocommerce

How make wordpress text widget with text from post for each category woocommerce?
It's easy!

  • install plugin Enhanced Text Widget;
  • add code in Enhanced Text Widget textarea;
<?php  
function show_text($id)
{
$my_postid = $id;
$content_post = get_post($my_postid);
$content = $content_post->post_content;
$content=apply_filters('the_content',$content);
$content = str_replace(']]>', ']]>', $content);
echo $content;
}

global $wp_query;
$cat_obj = $wp_query->get_queried_object();

$category_name = $cat_obj->name;

switch($category_name){
case 'Test1': show_text(22);break;
case 'Test2': show_text(23);break;
case 'Test3': show_text(24);break;
case 'Test4': show_text(25);break;
}
?>

Теги: , , ,

Дата: 6 июня 2014

Автор: Аноним

Комментарии: 51

Комментарии: 51

  1. tagra 20 mg prescription tadalafil online maxim peptide tadalafil citrate

  2. Many thanks really useful. Will certainly share website with my
    good friends. https://datingsitesover.com/

  3. You have the most impressive internet sites. http://ketodietione.com/

  4. hydrocloquin https://plaquenilx.com/# hydroxychloroquine 200 mg high

  5. hydroxychloriquine https://plaquenilx.com/# side effects of hydroxychloroquine

  6. what are the side effects of hydroxychloroquine https://plaquenilx.com/# define hydrochloric

  7. hydrchloroquine https://plaquenilx.com/# hydrocholoroquine

Оставить комментарий

*

Комментарий:

Ваш e-mail не будет опубликован.
Обязательные поля помечены *

Разрешенные HTML теги:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>