Use PHP code in tag div composer to grab post title

Posted in: Newspaper
Post count: 7

Hi, I am designing a single template with the TD Visual Builder. I have a raw HTML section there where i want to display the Post title in a <div> Element. I tried inserting the <?php the_title ?> and other options to get the post title via php but it didn’t have any effects whatsoever.
Did i oversee something or is it for html only?

Greetings

Post count: 35449

Hi,

If I understand correctly you want to create/make your own post template, if is so then you can do this using a single post template from tagDiv Cloud Library and tagDiv Composer, in this way you can use the elements from composer to display the post title, like this -> https://i.imgur.com/RG7C8y6.png

Thank you!

Post count: 7

Hi Calin,
thanks for the quick response though i might have miscommunicated my intention. Indeed i want to create a custom post template.I already took a template from the cloud library But i need to have a specific section in this template that i already have coded in html to display the post title. I am fairly sure now that this is only achieveable through manually inserting my code in the php file that i can find under …/wp-content/plugins/td-cloud-library/wp-templates/tbd-view-single/
If thats not correct i would appreciate if you could point me to the right direction.

Greetings

Post count: 35449

Hi,

So if I understand correctly you want to set some custom code for post title, if is so then the file for the single post template from tagDiv Cloud Library can be change from here -> wp-content/plugins/td-cloud-library/shortcodes/common/tdb_title.php

Hope this will help you!
Thank you!

Post count: 7

Hi Calin,
again thanks for response but i uploaded an image that illustrates this more clearly.custom post type So the Top section was doine in the composer and it’s a little limited because i also need to insert a link that comes as a custom field. The post title works fine as it is a module in the builder. I took Single_post_Template_5 from the cloud library and i need to insert my banner snipped in the source code of that specific template so i can use the get_post_title() and get_post_meta() functions to display or incorporate the fields that i need. Where could i find that source file?

Thanks in advance!

Greeting!

Post count: 7
Post count: 35449

Hi,

All the elements from single post templates can be found in this file -> wp-content/plugins/td-cloud-library/shortcodes/single but plice notice that the single post stiles are no more finical in php files, these are dynamical and the code for them is saved in database.

Thank you for your understanding!

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