No search results were found in Documentation!
With JS visual composer, I was able to use shortcodes, and it was also directly integrated with plugins like Easy Social Share plugin. I understand that integrating with popular third party plugins will take time, but there must be some ways to use Shortcodes on the homepage.
Even default WordPress ‘Text widget’ supports shortcodes but I couldn’t find a way to use it with the Tagdiv composer.
Here are two versions of code I have to use it one the homepage:
simple shortcode:
[easy-subscribe design=”design2″]
To use this shortcode into PHP templates:
<?php echo do_shortcode(‘[easy-subscribe design=”design2″]’); ?>
Kindly help me to use any of these on my homepage newly created with the TagDiv composer.
PS: I must say that TagDiv composer is far far faster than a Visual composer. So, congratulation TagDiv team for creating this.
Thank you. 🙂
Hi,
You could use a block shortcode and edit the category template or top post template. Create a block in a page then use that code like this
– https://www.screencast.com/t/r7SU5dc6N0
Enter it in the category template
– https://www.screencast.com/t/X2dSX18U5rK
– https://www.screencast.com/t/8r1UJxcdP
Or the top post style that you are using
– https://www.screencast.com/t/qIHxE53ProHd
– https://www.screencast.com/t/POrZs5D44zSy
<?php echo do_shortcode ('your shortcode here'); ?>
Please note that this may or may not work properly, the category pages cannot be edited by default or allow you to place elements in the structure.
Thanks
Hello m_xtar,
Unfortunately, our theme does not have any such an option but if you want to do this, you should edit the theme core files where the smart lists are made and inject your ad code using the do_shortcode method, like this -> <?php echo do_shortcode (‘[td_block_ad_box spot_id=”custom_ad_1″]’); ?>
Hope this helps!
Thanks for the message!
Hi bogdan, I sorry, but I need help, yet.
How I can identify if my home page é a — is_home() ?
Why don’t work yet ?
look please: I am using this Style – 1
<!–
Header style 1
–>
<div class=”td-header-wrap td-header-style-1″>
<div class=”td-header-top-menu-full td-container-wrap <?php echo td_util::get_option(‘td_full_top_bar’); ?>”>
<div class=”td-container td-header-row td-header-top-menu”>
<?php td_api_top_bar_template::_helper_show_top_bar() ?>
</div>
</div>
<div class=”td-banner-wrap-full td-logo-wrap-full td-container-wrap <?php echo td_util::get_option(‘td_full_header’); ?>”>
<div class=”td-container td-header-row td-header-header”>
<div class=”td-header-sp-logo”>
<?php locate_template(‘parts/header/logo-h1.php’, true);?>
</div>
<div class=”td-header-sp-recs”>
<?php
if(is_home()){
echo do_shortcode(‘[pro_ad_display_adzone id=18836]’);
}
else{
locate_template(‘parts/header/ads.php’, true);
}
?>
</div>
</div>
</div>
<div class=”td-header-menu-wrap-full td-container-wrap <?php echo td_util::get_option(‘td_full_menu’); ?>”>
<div class=”td-header-menu-wrap td-header-gradient”>
<div class=”td-container td-header-row td-header-main-menu”>
<?php locate_template(‘parts/header/header-menu.php’, true);?>
</div>
</div>
</div>
</div>
If this all right, so the problem is in (is_home())??
thank you very mutch
Hi, I want add in, ads only in home page, and to in other posts category, but I have a customer that want only on home page. How can i do this it ? Need be in Header.
I’m using the Plugin WP PRO ADVERTISING SYSTEM and their speaking to add this shortcode [pro_ad_display_adzone id=”18836″] or/and …
…but I don’t know where !!
looking the explication their.
_____________________________
Using the Template Tag
The “template tag” is the solution to add adzones to places on your website where you can’t use shortcodes or widgets. It allows you to hard code the adzone into your theme files on the exact location where you want the adzone to be.
To use the template tag first create the shortcode for your banner with all the options you like. Once you have the shortcode just copy and paste it into the template tag.
<?php
echo do_shortcode(“add the shortcode here”);
?>
Note: The template tag requires some PHP knowledge. It has to be added into your theme files so if you don’t know how to add the template tag contact your theme developer, provide him the template tag and ask where it should be added to show the adzone where you want it to be.
Default Template Tag Example
<?php
/**
* id = {adzone_id}
*/
echo do_shortcode(“[wpproads_banner id=123]”);
?>
Hello,
Sorry but smart list can only receive the smart list ads from the ads section of the theme panel: https://www.screencast.com/t/XPc2vGAK4Ulu
If you require other ad implementation you will have to do it custom in the theme files if you know your way around coding: https://www.screencast.com/t/hE3XgyEX4R
You can maybe try a do_shortcode function. Here is an example: https://forum.tagdiv.com/topic/shortcode-echo-on-smart-list-page/
Thank you!
Hi there,
I would like to apply the same principle but for the mobile theme. What files do I have to edit to add <?php echo do_shortcode (‘[td_block_ad_box spot_id="custom_ad_1" tdc_css=""]‘); ?> for the mobile homepage?
A quick update-
To call shortcodes in php, one can use:
<?php
echo do_shortcode('[CONTACT-US-FORM]');
?>
Perhaps adding div to them is more smoother. </br> after div can be used to create breaks though.
Conclusion: I was indeed unable to set up bbPress completely (tried everything, but there are many bugs which just can’t be fixed, including enabling tinymce support in mobile theme functions).
So, i rather installed phpBB on subdomain (https://doc.medicforyou.in). Funny bbPress installation messed up phpBB installation and i couldn’t use forum.medicforyou.in since the directory of wordpress was also pointing to subdomain, thereby, creating two phpBB installations- https://medicforyou.in/forum and https://forum.medicforyou.in .
For those requiring help on installation of https over subdomains- simply add same cloudfare origin certificate settings to your subdomain (Guide).
Thank you for support, i wish there was compatibility of mobile theme with bbpress. Never mind. 🙂
Hi,
I have tried to insert shortcode in category description but i can´t to do it.
I have inserted in functions.php the next code:
add_filter('term_description', 'shortcode_unautop');
add_filter('term_description', 'do_shortcode');
But it doesn´t works. With other themes this code in functions.php works fine.
¿What can i do? With plugin html in category description I can to put html code but I need shortcodes to insert ads in category descriptions.
¿What can i do to works shortcodes in category description with newspaper theme?
Waiting your response,
Regards,
Prometheus
Hello alexsr9,
Unfortunately, our theme does not have any such an option that allows you to add ads for category pages. If you want to add some ads there, you should edit the category pages and use do_shortcode method, like this
<?php echo do_shortcode ('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
– https://www.screencast.com/t/gBZ5dwc4OJ
If you will check by above screenshot, there you will see the folder name which has to be edited if you want to add some ads to your category pages. This is a simple example but if you want to display more levels in our theme and if you are not aware of the steps which are needed to take in this regard, please consider hiring a freelancer/developer to help you because we cannot provide custom services at the moment, sorry!
Hope this helps!
Thanks for your understanding!
Hello,
I’m wondering if there’s a way to add subtitles to the excerpts of my post, so that the excerpt has a title and a subtitle. I’d like these to display on my homepage. My website is finalfatloss.com
Just wondering if there’s a way to do this.
In another thread, I saw this code that might be useful:
<?php $td_subtitle_module = get_post_meta($this->post->ID, ‘td_post_theme_settings’, true); ?>
<p class=”td-sub-title”><?php if(!empty($td_subtitle_module[‘td_subtitle’])){echo $td_subtitle_module[‘td_subtitle’];} ?></p>
But I’m not quite sure how to integrate it.
Here’s my front-page-php code:
<?php
/* Home page */
get_header();
// display – Your latest posts
// @see https://codex.wordpress.org/Function_Reference/is_home
if (‘posts’ == get_option(‘show_on_front’)) {
?>
<div class=”td-main-content-wrap td-blog-index”>
<div class=”td-container”>
<div class=”td-crumb-container”>
<?php echo td_page_generator_mob::get_home_breadcrumbs(); ?>
</div>
<div class=”td-main-content”>
<?php
locate_template(‘loop.php’, true);
echo td_page_generator_mob::get_pagination();
?>
</div>
</div> <!– /.td-container –>
</div> <!– /.td-main-content-wrap –>
<?php
// display – A static page
} elseif ((‘page’ == get_option(‘show_on_front’)) && is_front_page()) {
//prepare the loop variables
global $paged;
$td_page = get_query_var(‘page’) ? get_query_var(‘page’) : 1; //rewrite the global var
$td_paged = get_query_var(‘paged’) ? get_query_var(‘paged’) : 1; //rewrite the global var
//paged works on single pages, page – works on homepage
$paged = max( $td_page, $td_paged );
$td_list_custom_title =__td(‘LATEST ARTICLES’, TD_THEME_NAME);
?>
<div class=”td-main-content-wrap td-main-page-wrap”>
<?php
// display Big Grid Mob 1 and the content at the top of the page
if ( empty( $paged ) or $paged < 2 ) { //show this only on the first page
if ( have_posts() ) { ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class=”td-container”>
<?php echo do_shortcode(‘[td_block_big_grid_mob_1 sort=”featured”]’); ?>
<?php the_content(); ?>
</div>
<?php endwhile; ?>
<?php }
}
?>
<div class=”td-container td-pb-article-list td-main-content” role=”main”>
<?php if ( empty( $paged ) or $paged < 2 ) { ?>
<h4 class=”block-title”><span><?php echo $td_list_custom_title; ?></span></h4>
<?php }
$posts_per_page = get_query_var(‘posts_per_page’) ? get_query_var(‘posts_per_page’) : 10;
// query used on Latest Articles section
$wp_query_args = array(
‘ignore_sticky_posts’ => 1,
‘post_status’ => ‘publish’,
‘posts_per_page’ => $posts_per_page,
‘paged’ => $paged,
);
query_posts($wp_query_args);
locate_template(‘loop.php’, true);
echo td_page_generator_mob::get_pagination();
wp_reset_query();
?>
</div>
</div>
<?php
}
get_footer();
Thank you.
Best,
Dan
Thanks. Does the do_shortcode() method match me, just which file do I edit? This one in the link to the screen is one entry I guess? Need to check first in some loop of the number which in the order in the list is the entry and if 4 is followed by it do_shortcode ();
like this:
<?php
$postnum = 0;
while(have_posts()) : the_post();
if($postnum == 3) {
echo do_shortcode (‘[td_block_ad_box spot_id=”custom_ad_1″]’);
$postnum = 0;
}
//view another category entry
$postnum++;
endwhile;
?>
PS. Sorry for my bad english.
Hello ytre77,
Unfortunately, our theme does not have any such an option that allows you to add ads for category pages. If you want to add some ads there, you should edit the category pages and use do_shortcode method, like this ->
<?php echo do_shortcode (‘[td_block_ad_box spot_id=”custom_ad_1″]’); ?> -> https://www.screencast.com/t/gBZ5dwc4OJ
Thanks for your understanding!
Hi Bogdan, thank you for your support.
This is my website:
http://www.pcusb.it
In my home the space between grid and header is correct, but in my page category “Mac” not.
I insert my news ticket with this code:
<?php echo do_shortcode(‘[td_block_trending_now tdc_css=””]’); ?>
Thanks and sorry for my English.
Hi,
You need to edit the header template style that you are using, not the theme main header file
– https://www.screencast.com/t/izGVKF0NX
If you want to use a single image element from Visual composer you can use it like this, with a do_shortcode
– https://www.screencast.com/t/Ynj7zAgzrvE
– https://www.screencast.com/t/lmq3o1130d22
– https://www.screencast.com/t/Wgazx9Kp
– https://www.screencast.com/t/KXJJSwdfy0c
You can use a code like this, just enter your shortcode as shown in the screenshots
<?php echo do_shortcode ('your shortcode here'); ?>
Thanks
Hello,
Sorry but our news ticker does not have that kind of layout as seen on the site you mentioned.
There are only 2 styles available for the ticker: https://www.screencast.com/t/W8zpJViil
Categories cannot be edited like static pages using visual composer so you cannot add block elements to them unless you add them through coding.
Here is an example of a trending now block added through a do_shortcode function in the category top post files https://www.screencast.com/t/k9zFLrYkEg
Here is the code used: <?php echo do_shortcode('[td_block_trending_now tdc_css=""]'); ?>
Thank you!
Hi,
It can be possible, with a shortcode. You need to edit the post template files that you want. Each post template has a corresponding single.php file and a loop-single.php file.
– https://www.screencast.com/t/oMIWFDRu
By editing these templates you can insert the shortcode in the post structure, for the post templates you want.
Like in this example for post template 2, where the code is inserted above the top social sharing
– https://www.screencast.com/t/RGtLW6IbQWI
– https://www.screencast.com/t/4xrvqho6WA4
You could experiment with other positions in the post structure.
This is the code used in the example
<?php echo do_shortcode ('[td_block_trending_now tdc_css=""]'); ?>
Thanks
Need shortcode in the description of the categories, but they dont get rendered. Which shortcode plugin works with youre Newspaper Theme? What i have to do to make it work? Adding add_filter( ‘category_description’, ‘do_shortcode’ ); to the functions.php has no effect.
Hi,
There is no option to add blocks in the post content. However, you can try to use a do_shortcode to insert it
– https://www.screencast.com/t/MvdKju9Y58
You must edit the corresponding file to the post template that you are using. For example post template 2, you need to edit loop-single-2.php and insert the block you want in the post structure (below the related article section if that is what you want). Please note that this may not work properly, and cause unexpected results since blocks were not meant to be used in posts. You can try this solution and see if you can manage this, maybe with additional modifications.
This is the code used in the example
<?php echo do_shortcode ('[td_block_1]'); ?>
Thanks
Hello wilfredo,
Unfortunately, our theme does not have any such an option that allows you to add ads for category pages. If you want to add some ads there, you should edit the category pages and use do_shortcode method, like this ->
<?php echo do_shortcode (‘[td_block_ad_box spot_id="custom_ad_1"]‘); ?> -> https://www.screencast.com/t/gBZ5dwc4OJ
Thanks for your understanding!
Hello zugre,
You should edit the loop files according to your post template used by you, like this -> https://www.screencast.com/t/I8FX5cr0 You should use the do_shortcode method to inject the shortcode as you wish. For more information about this way, please check the following topic here -> https://forum.tagdiv.com/topic/two-questions-please/
Thanks for the message!
BTW, here’s an updated snippet for wp-content/themes/Newspaper/parts/header/td-login-modal.php …
echo '
<div id="login-form" class="white-popup-block mfp-hide mfp-with-anim">
<div class="td-login-wrap">
<i class="td-icon-modal-back"></i>
<div id="td-login-div" class="td-login-form-div td-display-block">
<div class="td-login-panel-title">' . __td('Sign in', TD_THEME_NAME) . '</div>
<div class="td-login-panel-descr">' . __td('Welcome! Log into your account', TD_THEME_NAME) . '</div>
<div class="td_display_err"></div>
<div class="td-login-inputs"><input class="td-login-input" type="text" name="login_email" id="login_email" value="" required><label>' . __td('your username', TD_THEME_NAME) . '</label></div>
<div class="td-login-inputs"><input class="td-login-input" type="password" name="login_pass" id="login_pass" value="" required><label>' . __td('your password', TD_THEME_NAME) . '</label></div>
<input type="button" name="login_button" id="login_button" class="wpb_button btn td-login-button" value="' . __td('Login', TD_THEME_NAME) . '">
<div class="td-login-info-text">' . __td('Forgot your password? Get help', TD_THEME_NAME) . '</div>
<div style="position:relative;top:6px">' . do_shortcode('[apsl-login-lite]') . '</div><div style="position:relative;bottom:27px">' . $users_can_register_link . '</div>
</div>
' . $users_can_register_form . '
<div id="td-forgot-pass-div" class="td-login-form-div td-display-none">
<div class="td-login-panel-title">' . __td('Password recovery', TD_THEME_NAME) . '</div>
<div class="td-login-panel-descr">' . __td('Recover your password', TD_THEME_NAME) . '</div>
<div class="td_display_err"></div>
<div class="td-login-inputs"><input class="td-login-input" type="text" name="forgot_email" id="forgot_email" value="" required><label>' . __td('your email', TD_THEME_NAME) . '</label></div>
<input type="button" name="forgot_button" id="forgot_button" class="wpb_button btn td-login-button" value="' . __td('Send My Password', TD_THEME_NAME) . '">
<div class="td-login-info-text">' . __td('A password will be e-mailed to you.', TD_THEME_NAME) . '</div>
</div>
</div>
</div>
';
Please let me know where the files are for the mobile version so I can start fiddling with it.
-
This reply was modified 9 years by
tomashley.
Hello dileep,
Unfortunately, our theme does not have any such an option regarding on carousel slider for category pages, sorry! Also, notice that the Visual Composer cannot be used for Category pages but only if you will use the do_shortcode method. For more information about this way, please check the following topic here -> https://forum.tagdiv.com/topic/two-questions-please/
Thanks for the message!
Hello Kallithea,
Unfortunately, our theme does not have any such an option that allows you to add some ads at category page, sorry! You should edit the category template and through do_shortcode method you can add what add you want. For more information about this case, please check the following topic here -> https://forum.tagdiv.com/topic/two-questions-please/
Thanks for the message!
Hello goldfish45,
If you want to add some content below the related articles section for each post, you should edit the post template file according to your post template used by you, like this -> https://www.screencast.com/t/dJtucrDrn9e You should use the do_shortcode method to add what element you want.
<?php echo do_shortcode ('your shortcode here'); ?>
Thanks for your understanding!