how to add custom shortcode in single post template

Posted in: Newspaper
Post count: 32

My default post template is a single post template imported from the cloud library. I’d like to add a piece of php code to the post template.

In other themes I’ve used before, I normally add my shortcode change ot single.php file. I’m not sure which file to edit in the newspaper theme.

The single post and LOOP files in “wp-content\plugins\td-composer\legacy\Newspaper\parts” seems to be for the existing 13 templates, none of them are the one I’m using.

I tried with no avail adding from control panel -> appearance -> theme editor -> loop-single.php

My ultimate goal is to add this piece of code “<?php xh_social_share(); ?>” under my post title.

Which file am I supposed to edit?

Thank you for your help.

Post count: 35449

Hello,

All the elements from single post template are set in -> wp-content/plugins/td-cloud-library/shortcodes/single if your code is for sharing then maybe you can set it in wp-content/plugins/td-cloud-library/shortcodes/single/tdb_single_post_share.php

Thank you!

Post count: 32

Thank you Calin, this is super helpful.

Post count: 32

I found a problem that my post excerpt is showing embedding code. As shown in this picture the left bottom cornor https://www.screencast.com/t/rbrIysH0t

I have videos embedded in my posts using iframe, is there a way to not show code in excerpt?

PS: The video is from a 3rd party website (it doesn’t have embed shortcode in gutenburg), I can’t embed it through the media library URL option. The only way I can find is to insert video embed code in the classic editor.

my video embedding code is:

<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class=’embed-container’>
<iframe frameborder=”0″ src=”https://………………..” allowFullScreen=”true”></iframe>
</div>

Post count: 35449

Hello,

Please make sure that you do not have a plugin conflict, please deactivate ALL plugins except tagDiv Composer, also if you are using child theme or cache plugin, deactivate them, clear all cache and try again.

If there is still a problem, you can send us an email at contact@tagdiv.com and provide admin login, as well as cPanel or FTP if possible. We will take a look. Include a link to this topic in the email.

Thank you!

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