Show Categories in Blocks

Posted in: Newspaper
Post count: 19

How can I add categories to block meta ?

Post count: 7909

Hi,

In Newspaper 5 will be an option to add categories on modules/blocks from Theme Panel.
Until then you have to copy get_category function to module that you want to appear categories – http://screencast.com/t/o1umsNHNb and echo categories where you want to display and you can follow these related topics:

https://forum.tagdiv.com/topic/category-display-info/
https://forum.tagdiv.com/topic/show-categorie-name-in-latest-articles/

Thanks!

Post count: 19

Hello. I am using 8 and 2 no. blocks. I have that function already at td_module_blog.php = http://i.imgur.com/qXzzEc4.png

Can you just paste block 2 and 8 codes for me ?

td_module_2.php http://pastebin.com/vUWPbnJA
td_module_8.php http://pastebin.com/P1PSKJeU

  • This reply was modified 11 years by blithe.
Post count: 7909

Hi,

Number of modules are not the same with number of blocks. For example block 2 is made from module 5 and 3 please take a look here – https://forum.tagdiv.com/modules-and-blocks/
So if you use the block 8 you have to edit module 5 and replace with this code – http://pastebin.com/z8kLLY5j
You have to do the same for each module where you want categories just paste get_category function that you have in module_blog file and echo categories where you want to show up: http://screencast.com/t/cf1Pr7xn

<?php echo $this->get_category();?>

Result for block 8: http://screencast.com/t/FVlDOK3k

Thanks!

Post count: 19

Hello. After I replaced module 5 with that code(http://pastebin.com/z8kLLY5j) I am getting parse error :

Parse error: syntax error, unexpected $end, expecting T_FUNCTION in /usr/share/nginx/html/wp-content/themes/Newspaper/includes/modules/td_module_5.php on line 90

Post count: 7909

Hi,

I tested again the code from pastebin and it works fine, please make sure that you copy all the code I provided to you. At line 90 it must be }: http://screencast.com/t/FVqKXtDTVbr
Here is my result with that code and it should work also for you: http://screencast.com/t/sHhCPuH9bny

Thanks!

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.