Get Current Category Posts on Widgets

Posted in: Newspaper
Post count: 9

Hello,

It is possible at tagDiv Blocks add and option on Category filter?
I Want on each article to get articles from same category!

Thanks a lot!

Post count: 7909

Hi,

TagDiv blocks have an option to filter articles by category: http://screencast.com/t/xzayrXTFrK
If this is not what you mean please provide more details.

Please also follow our documentation: https://forum.tagdiv.com/newspaper-documentation/

Thanks!

Post count: 9

I mean something different,
on sidebar Blocks as this: http://puu.sh/fsmJl/05966c9ced.png, to have and option to get category of current post,
if post category is “CAT A” to filter posts by “CAT A”, but if the post category is “CAT B” to filter posts by “CAT B”.

Like as: get_the_category( $post_id ), and use the first category of post to filter!

Thanks a lot!

Post count: 1291

Hi,

You could set a custom sidebar for each category from Theme Panel -> Categories , use blocks that display posts from that specific category.
The posts by default inherit the sidebar from their category. You can also exclude current post from the query – http://screencast.com/t/nA1mQ7EENM

Thank you, Emil G.

Post count: 9

Ok, thanks! I make some other changes.

One more question,
who will find the title for each block as this?
I mean in code, because i want to make the same change!

Thanks a lot!

Post count: 1291

Hi,

Not sure what you mean, please provide more details.

Thank you, Emil G.

Post count: 9

Hello,

i make these changes: http://puu.sh/fTSlf/3edc259c79.png

Now, when i select the category No.1 (Uncategorized) are displayed the articles of the current category, but the link of the title is the link of Category No. 1. (http://puu.sh/fTTkl/06f36d9de9.jpg)

I want to add the same code on title link.

And second question:
How do I add more Custom Ads?

Thanks a lot!

Post count: 6600

Hi,

1. I’m not sure what your issue is as if you don’t set an custom url or title for your block then by default the category name and url are set, you can set them yourself from block settings: http://screencast.com/t/3Xs1cVkyy9c
If this not what you mean, please provide more details and also send your site’s URL with an example.
2. I have posted a solution for this here: https://forum.tagdiv.com/topic/sidebar-ads/#post-21850

Thanks

Post count: 9

For first:

after the changes i saw posts of current category, but the title is link to Category No.1 (Uncategorized). I want to link with current category as the posts.

Look this link:
http://goo.gl/dBw52Z

Make a tour at differents categories, you see on right sidebar posts from same category, but the title always linked to Category No.1.

Thanks a lot!

Post count: 6600

Hi,

Please remove this code you’ve added to the block query then test again: http://puu.sh/fTSlf/3edc259c79.png
I believe that your change to the query is affecting the block title. I suggest you use the code Emil provided: http://screencast.com/t/nA1mQ7EENM

Thanks

  • This reply was modified 11 years by Lucian.
Post count: 9

No,
i want my code.

i want to add the same code on block title.

Look this: http://puu.sh/gGDXD/5978b4fdd5.png

Now i select the Category ‘Uncategorized’ and each post i see articles from same category NOT from Uncategorized.

BUT the Title of block is linked to ‘Uncategorized’. I want also to when i click on block title to go at Current Category.

Thanks a lot!

Post count: 6600

Hi,

Not sure how posts from that block widget aren’t from the “uncategorized” category while you’ve set it to filter posts from that category.
My guess is that your custom code is affecting the widget block query and causes this. The block title link correctly to the “uncategorized” category as this is the normal behavior of block title url, to link to the filtered category if an custom url is not set.
If you want that the block title to link to the filtered category then go over your custom code as the normal behavior of this should be as you need it.

Thanks

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