Add Related Articles in Custom Sidebar

Posted in: Newsmag
Post count: 11

Hi there,

Just like the topic title, i am customizing the Post template and i am in the middle of creating my own sidebar. and so i was wondering how can i add related articles box (or rather, how to filter the posts with same category) inside the custom sidebar widget that i created?

In terms of ‘related’, other than same category, is there any other way to define it?

Thanks!

Post count: 35449

Hi,
The related article option can be enable only from theme panel and is not displaying in sidebars only at the bottom of articles also this can be filtered only by category or tag -> https://i.imgur.com/4dtrIqi.png
In sidebar you can set only widgets and those has only normal filters -> https://i.imgur.com/s7ISeXW.png
Thank you!

Post count: 11

Hi Calin,

Thanks for the reply. Hmmm, in that case, is there a shortcode that i can echo in some php code to show the related articles?

This is because i think i can use related articles, but i wish to put it at the sidebar instead of bottom of the post.

Post count: 35449

Hi,
In case that you do not have many categories, then it is a better idea to make sidebar for each category and and set in it a block that it is filtered after that category (after that you set the correspondent sidebar for each article).
In case that you have many categories and articles, then the above suggestion is not so good and the only way is to make changes in theme files and the code used for this is on this file path -> wp-content/plugins/td-composer/mobile/includes/modules/td_module_single_mob.php -> https://i.imgur.com/mfRpJ3i.png you need to set that code in posts sidebars -> wp-content/plugins/td-composer/legacy/Newsmag/parts/single
I hope this will help you!
Thank you!

Post count: 11

Hi Calin,

Thanks for the reply.

Unfortunately, i am a bit confused with your suggestion on adding code from wp-content/plugins/td-composer/mobile/includes/modules/td_module_single_mob.php into posts sidebars -> wp-content/plugins/td-composer/legacy/Newsmag/parts/single…

How can i do so?

To make it clearer, please go to this link: http://verztec-online.com/clients/annals/recurrent-vascular-events-in-ischaemic-stroke-patients-with-diabetes/ and look at the Sidebar on the bottom right side. I am trying to add Related Articles inside sidebar here.

So basically, i want the Related Articles box (located at bottom of every Posts) to be shifted into the Sidebar instead.

Hopefully this is illustrating my situation better.

Looking forward for your advice!

Thank you in advance.

Post count: 11

Hi Calin,

I have found a solution for this by adding these code below:
$td_mod_single = new td_module_single($post);
echo $td_mod_single->related_posts();

.. inside the Posts’ single template file.

Thanks again for the suggestions!

Post count: 35449

Hi, I’m glad that you manage the situation!
Have a nice day!

Post count: 33

Hello Calin,

I have a question about this please, I have checked the post settings and i found the related articles section is missing, please adivse.

Post count: 35449

Hi Mido, can you please let me know some more details? The related articles section is missing from the theme or from theme files? Can you please provide some screenshots? also what theme version are you using?
Thank you!

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