How to show it in main content in article page
not a right approach to create it manually , i think it is better to modify td_module.php code instead creating redirect for every category page.
if (is_category()) {
$catID = $categories[0]->category_parent;
$subcats = get_categories(‘child_of=’ . $catID);
foreach ($categories as $category) {
if ($category->term_id == get_query_var(‘cat’)) {
$selected_category_obj = $category;
break;
}
}
}
lol ok , i know how to do it using loop.php, but is there any way to do it in category module. For example for category page i am using td_module_2.php
++ i just want to do it for parent category pages and not for sub categories. Any help will be really appreciable as i already wasted my hours and default category templates of newspaper look so weird
SubCat1 Post 1 Post 2
SubCat2 Post 1 Post 2
SubCat3 Post 1 Post 2
loop.php
` if(is_category()){
$categories = get_the_category();
$catID = $categories[0]->category_parent;
$subcats = get_categories(‘child_of=’ . $catID);
foreach($subcats as $subcat) {
echo ‘<h3>’ . $subcat->cat_name . ‘</h3>’;
echo ‘<ul>’;
$subcat_posts = get_posts(‘cat=’ . $subcat->cat_ID);
foreach($subcat_posts as $subcat_post) {
$postID = $subcat_post->ID;
echo ‘<li>’;
echo ‘<a href=”‘ . get_permalink($postID) . ‘”>’;
echo get_the_title($postID);
echo ‘</a></li>’;
}
echo ‘</ul>’;
}
}`
-
This reply was modified 8 years by
Mayank Kapahi.
-
This reply was modified 8 years by
Mayank Kapahi.
-
This reply was modified 8 years by
Mayank Kapahi.
when you are planing to release new update?
After exploring a bit I found the code for category page is coming from td_module.php and loop.php
if (have_posts()) {
while ( have_posts() ) : the_post();
echo $td_template_layout->layout_open_element();
if (class_exists($td_module_class)) {
$td_mod = new $td_module_class($post);
echo $td_mod->render();
} else {
td_util::error(__FILE__, ‘Missing module: ‘ . $td_module_class);
}
echo $td_template_layout->layout_close_element();
$td_template_layout->layout_next();
endwhile; //end loop
echo $td_template_layout->close_all_tags();
Can you please provide any help in showing category page by order of subcategories seperately. Example
Category page:
Category Name
Subcategory Name 1- Posts of 1
Subcategory Name 2- Posts of 2
Subcategory Name 3- Posts of 3
And can you please tell where is a query for fetching categories and there posts?
http://qc.round.glass/blossom/category/make-them-eat-eat-n-grow/
-
This reply was modified 8 years by
Mayank Kapahi.
🙂 seems like i need to do lot of work with newspaper theme
-
This reply was modified 8 years by
Mayank Kapahi.
Me too 🙂
Thanks for your reply
But it mixup all post of parent and child right now, i need something link below :
it is a newspaper child theme
Question : How to increase size for: td-main-content-wrap td-main-page-wrap td-container-wrap. I want to set it 100%. Do i need to add css or there is settings available?
it is showing width :
.td-boxed-layout .td-container-wrap {
width: 1164px;
/* width: 100%; */
}
Thanks for your reply and support
Thanks for your reply