Search Results for 'do_shortcode'

    No search results were found in Documentation!

Results from the Forum
Andrei L.
tagDiv Member

Hi

For header ads please check this link: https://forum.tagdiv.com/topic/different-header-ads-on-each-page/ I’ve posted a solution there, you may use it and eventually adapt it as needed. To get the shortcode add an ad box into a blank page then switch in backend editor copy and paste this code: http://screencast.com/t/Kcqsjk9C7xbU inside do_shortcode function For the ads from page content you can use the ad box block and use the corresponding spot for your ad: http://screencast.com/t/YlkV5d5yke
For ads from post content you will need to modify the td_module_single_base.php file and add your conditions here: http://screencast.com/t/xnSMzdwiz

Thanks!

Catalin
tagDiv Staff

Hello gunner05,

If you want to insert ads on these post templates it is necessary to use do_shortcode method with the custom ad to achieve this. You should alter this file -> single_template_9, 10, 11.php. First of all, you should insert your ad code in Custom Ad 1 field from Theme Panel like this: http://screencast.com/t/fFL1w7Ty and then, with this code -> do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?> you have to add them in the according file, like this -> http://screencast.com/t/ljmd8SCNllR3 http://screencast.com/t/HWyRljFY
-> http://screencast.com/t/Wd6n3DMBou

The result -> http://screencast.com/t/hgFlJUhoyv -> http://screencast.com/t/nRmcQ3kq7b

Hope this helps and let us know how it goes!

Thank you for the message!

ajayrijh
tagDiv Member
    /*
     * Detect the video service from url
     */
    function detectVideoSearvice($videoUrl) {
        $videoUrl = strtolower($videoUrl);
        if (strpos($videoUrl,'youtube.com') !== false or strpos($videoUrl,'youtu.be') !== false) {
            return 'youtube';
        }
        if (strpos($videoUrl,'dailymotion.com') !== false) {
            return 'dailymotion';
        }
        if (strpos($videoUrl,'vimeo.com') !== false) {
            return 'vimeo';
        }
        return false;
    }

Perhaps I could add something here to define a case ‘html5’ for a number (id 770) and then add the do_shortcode for function renderVideo($videoUrl) case ‘html5’?

  • This reply was modified 10 years by ajayrijh.
ajayrijh
tagDiv Member

Sorry Andrei – took a break for the holidays ! hope you had a great holiday and are excited/enjoying the new year!!

As for the response – are you sure it wouldn’t be an update to td_video_support.php under the wp_booster folder? I see here the case scenarios for youtube, vimeo, and dailymotion. Could I add in a do_shortcode here and get the ID for the shortcode since that is a required parameter? (i.e. [videoadplayer id= “770”]) and thus all I will have to do is put 770 into the “featured video” box on creating the post.

Let me know your thoughts! Thanks for the great support 🙂

-Ajay

Andrei L.
tagDiv Member

Hi


@leeyokeloong
thanks for sharing your solution here!

@flynewsgr
please provide your site url or the html code that you’re using for header ad so I can inspect this closer. You can use the do_shortcode(‘ ‘) function and insert the ad shortcode from VC: http://screencast.com/t/W4SFKPnoShnhttp://screencast.com/t/lqaJxdVdMee into a text block: http://screencast.com/t/imRGS1aHN then add that text block in your sidebar.

Thanks!

Catalin
tagDiv Staff

Hello techlive,

If you want to add another ad just above the tags into your smart list post, you have to use do_shortcode method with the custom ad. To display the ad in the desired place, first of all, you should insert your ad code in Custom Ad, like this: http://screencast.com/t/oasFD3Txm and then you have to alter td_smart_list_7.php file like this: http://screencast.com/t/cdohMstuIIc and the result you should see here: http://screencast.com/t/oQx6739Ad
The code is here -> http://pastebin.com/LNTtgU0y

Hope this helps and let us know how it goes!

Thank you for the message!

Bogdan B.
tagDiv Staff

Hello,
Unfortunaltey you will have to set the ad manually from the theme files and remove the one from the theme panel.
You can use this code:
$buffy .= do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); like so:
http://screencast.com/t/NICjbCRzYRQc
I hope this helps.
Thank you!

Catalin
tagDiv Staff

Hello colgate,

If you want to insert ads on your category page it is necessary to use do_shortcode method with the custom ad to achieve this. You should alter this file -> category.php. First of all, you should insert your ad code in Custom Ad 1 field from Theme Panel like this: http://screencast.com/t/fFL1w7Ty and then, with this code -> <?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?> you have to add them in the category.php file, like this: http://screencast.com/t/x1oLmljEm and the result you should see here: http://screencast.com/t/K9dbYWkeBfk

Hope this helps and let us know how it goes!

Thank you for the message!

Catalin
tagDiv Staff

Hello todaybase,

If you want to have the permanent text in all your articles, you have to insert your snippet of the code in get_content () function from td_module_single_base.php. If you are using a do_shortcode method to put your text on your site, you have to use like this: http://screencast.com/t/7F8J8zmJ otherwise, http://screencast.com/t/v8pPfV81pR9

Hope this helps and let us know how it goes!

Thank you for the message!

Catalin
tagDiv Staff

Hello seosmart,

Unfortunately, we cannot provide support for untested plugins, as you said Bogdan B above. Unfortunately, we have not tested these kinds of plugins and cannot say for sure if it will work with Newspaper theme. We have no idea of the plugin functionality so we cannot make a suggestion on how to use it best with our theme. You could try to contact the plugin’s author and ask him for advice, maybe he can point you to the right direction. Aslo, if you want to insert a shortcode in our theme, you have to use this function <?php echo do_shortcode('enter your short_code here');?> in corresponding file.
If it necessary custom work, please consider hiring a freelancer to do this for you as we cannot provide custom work at this time, sorry!

Thank you for your understanding!

Bogdan B.
tagDiv Staff

Hi,
Unfortunately as i have stated above, there is no easy solution for this as the theme has no such option. I already provided a solution above and i will provide another one.
You can try by using a do_shortcode function so instead of the $buffy .= “\n \n\n”; and $buffy .= “\n \n\n”;

you can use your shortcodes like so:

$buffy .= do_shortcode('[wp_cookie_privacy_lock]');
$buffy .= do_shortcode('[wp_cookie_privacy_lock]');

and use it like the screenshots above.

Please keep in mind that the theme is not tested with this type of plugins and i cannot guarantee it will work. If you do not want to try the solutions i provided you can turn to an ad manager plugin to render your ad codes and use theme’s ad spots just for placements, in that case you can use plugin’s shortcodes to place your ads on theme’s specific ad spots.

Thank you!

Catalin
tagDiv Staff

Hello Jean-Paul,

If you want to use the Visual Composer in your header, it is neccesary to use do_shortcode from the generated code of the Visual Composer. You have to insert this in header_style used by you. (header_style_1, header_style_2, ….).

Below, I gave you an example for header_style_1 and I added a text block in this kind of header with Visual Composer. You have to follow these steps for any header style used by you – http://screencast.com/t/6gTYtbdo

Useful screenshots -> http://screencast.com/t/y1sREKfUhttp://screencast.com/t/IcFTzoWYJ

Also, you have to make a different class with this shortcode because you will to need of this because are required to do some customisation using Custom CSS to give a better look.

<?php echo do_shortcode('enter visual composer element here');?>

The result you should see here: http://screencast.com/t/RSzP7Xol

Hope this helps and let us know how it goes!

Thank you for the message!

Andrei L.
tagDiv Member

Hi

You can try to use the do_shortcode function in single_template_11.php file like here: http://screencast.com/t/vgE0eaqNM9 but i am not sure that the video will be displayed because the theme have video support only for youtube, vimeo and dailymotion.

Thanks!

shae101s
Participant
#0

Hey all, just a quick question. I know NewsPaper and Newsmag themes already have the lightbox functionality for single image, so hopefully this shouldn’t be too tedious to do. I wanted for each Gallery inserted into the post that it would open in a lightbox like seen here: http://thecurvyfashionista.com/2015/12/new-years-eve-plus-size-dress/ and the image attachments would show like they do in the ligthbox of the post example linked. It uses the default WordPress gallery with some php and css tweaks.

I see on that site they use the image.php or the attachment.php file and some css to do this, my question is, in NewsPaper’s attachment.php what would I need to tweak to possibly get it to sit in a similar layout for the galleries? Or would I need to create a separate file that only targets when galleries are added to a post? Please advise.

I can add in the php file code they are using:


<?php
/**
* @package WordPress
* @subpackage TCF2015
*/
get_header();

if ( have_posts() ) : while ( have_posts() ) : the_post();
//count total images + find current image number
global $post;
$attachments = get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) );

$count = count( $attachments );
$specific = array();
$i = 1;
?>

<section id="mainContent">

<div id="photoFull">

<?php $att_image = wp_get_attachment_image_src( $post->id, "full"); ?>
id); ?>" rel="attachment" target="_new">" alt="" />

</div><!-- END photoFull -->

<?php
foreach ( $attachments as $attachment ) {
$specific[$attachment->ID] = $i;
++$i;
}
if($specific[$post->ID] == $count) { ?>
<aside id="seeMore">

<div class="sectionheader"><h2>More Galleries</h2></div>

<div class="clear"></div>

</aside><!-- END seeMore -->
<? } ?>
</section><!-- END mainContent -->

<aside id="sidebar">

<div id="infoHeader">

<div id="controls">

<div id="prevNext">

<div id="prev"><?php previous_image_link() ?></div>

<div id="count">
<?php echo "{$specific[$post->ID]}/{$count}"; ?>
</div>

<div id="next"><?php next_image_link() ?></div>

</div><!-- END prevNext -->

<div id="closeButton">post_parent); ?>" rev="attachment"></div>

</div><!-- END controls -->

<h1>post_parent); ?>" rev="attachment"><?php the_title(); ?></h1>

</div><!-- END infoHeader -->

<?php the_content();?>

<div class="socialIcons">

</div><!-- END socialIcons -->

<div class="ad_300x250">

<?php echo do_shortcode( '[adrotate group="3"]' ); ?>

</div><!-- END ad_300x250 -->

</aside><!-- END sidebar -->

<?php endwhile; else: ?>
<?php endif; ?>

<?php get_footer(); ?>

What of this would be added in to the existing NewsPaper attachment.php file to help me get the desired gallery layout?

Thanks!

Bogdan B.
tagDiv Staff

Hello,

You can use a do_shortcode function and place it in the category.php file like so: http://screencast.com/t/PmC7JPa1MBBhttp://screencast.com/t/i1dNzoivd6
You can get it above the pagination if you want by adding it above the pagination code:
http://screencast.com/t/t7fYlJSCA
<?php echo do_shortcode('[td_block_ad_box spot_id="content_bottom"]');?>
Thank you!

Catalin
tagDiv Staff

Hello nivosh,

You can set a block to be default post on your site for a certain post style if you are using do_shortcode and implement this code to properly file. You should find more details about do_shortcode in this link:
https://developer.wordpress.org/reference/functions/do_shortcode/

<?php echo do_shortcode('enter visual composer element here');?>

http://screencast.com/t/wYd49RkDhouW

Plese follow the steps from the screenshot below and implement this in your file core like this:
http://screencast.com/t/gL98XHqE9

The result :http://screencast.com/t/XwgE0wocy6j

Hope this helps and let us know how it goes!

If is not what you mean, please provide more details so I will provide a more accurate response.

Thank you for the message!

Catalin
tagDiv Staff

Hello crmnldan1729,

Unfortunately, there is no option for this. You will have to edit the theme core files in order to implement such a feature. You can use a do_shortcode function and use a visual composer single image element shortcode like so:
Add a text block element and place your image inside it. Use the settings for the block element to adjust size and other options: http://screencast.com/t/4tCoPuOs then enter classic mode and text mode to get the shortcode for the element: http://screencast.com/t/BEgP9Zgmn
Then you can use this code: $buffy .= do_shortcode('enter visual composer element here');
You have to place the code in the smartlist file corresponding to the smartlist you use:
http://screencast.com/t/ScY7NcJzeAhf .

This will make the text appear on the bottom of every slide.

The result you should see here: http://screencast.com/t/maQIoCfB4JQm

Hope this helps and let us know how it goes!

Thank you for the message!

Andrei L.
tagDiv Member

Hi

You need to edit td_module_single_base.php and add a condition like here: http://screencast.com/t/6PmoFo2Lwvd

if (td_util::is_ad_spot_enabled('content_top') and is_single()) {
if (in_category('you-category-name')){
echo do_shortcode('[td_block_ad_box spot_id="post_style_1"]');
}
else {
$content = td_global_blocks::get_instance('td_block_ad_box')->render(array('spot_id' => 'content_top')) . $content;
}
}

You need to replace your-category-name with the name/slug of your category.
Thanks!

Catalin
tagDiv Staff

Hello Sayeed,

Please make sure you have used the correct code and you have followed the steps below.

<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?>

I suppose that you want to place the ad below the first socials buttons, like this: http://screencast.com/t/mNWbshBgqc

The result you should see here: http://screencast.com/t/ViiCbYKCl

Hope this helps and let us know how it goes!

Thank your for the message!

Bogdan B.
tagDiv Staff

Hello,

Unfortunately there is no option for this. You will have to edit the theme core files in order to implement such an feature. You can use a do_shortcode function and use a visual composer single image element shortcode like so:
Add a single image element and place your image inside it. Use the settings for the block element to adjust size and other options: http://screencast.com/t/cII3MReWUA then enter classic mode and text mode to get the shortcode for the element: http://screencast.com/t/yxQaVF8PM
Then you can use this code: $buffy .= do_shortcode('enter visual composer element here');
You have to place the code in the smartlit file corresponding to the smartlist you use: http://screencast.com/t/saAZIJFjaAsn
This will make an image appear on the bottom of every slide. Just adding one image on the end of the smartlist is not so easy to do from the code as smartlists are based on a loop.

Thank you!

Andrei L.
tagDiv Member

Hi

To display a different header ads on pages you need to edit the ads.php file and add a set of conditions like here: http://screencast.com/t/E2qMgK02

if (is_page(page id)){
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
}elseif (is_page(page id)){
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_2"]');
}elseif (is_page(page id){
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_3"]');
}

To get the page id follow this link: http://screencast.com/t/hgeXHEyRRr0 Note that for the front page the function is: is_front_page() https://codex.wordpress.org/Function_Reference/is_front_page

Hope this help.
Thanks!

  • This reply was modified 10 years by Andrei L..
schindyguy
tagDiv Member

No need for a developer, but in case anyone else has the same question, it needed to be added to the Newspaper/loop-single.php as thats where the do_shortcodes can go to call my fb comments plugin and custom_ad_slot 1 which contains the taboola code.

Thanks for the help though!

Bogdan B.
tagDiv Staff

Hello,
you can use ads the same way with a do_shortcode function. For a block 21 you need to edit module 16 and add this code to it:
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]')?> like so: http://screencast.com/t/bmQjF5k6
This will insert an ad after every post in the module: http://screencast.com/t/xkKmZTqi9
It will need a bit of css to position it though if this is what you want.
Thank you!

Catalin
tagDiv Staff

Hello schindyguy,

If you are talking about the ads on category page, the simplest way to add this on that pages are to use a shortcode for each category top post template used, like this: http://screencast.com/t/icImxD0wIoVc

<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]')?>

Also, if you need to remove ads from certain post/pages, please check the topic below and implement this on your custom post type. https://forum.tagdiv.com/topic/remove-ads-in-certain-postpage/ You should put the condition in ads.php using a custom post type function. For more function reference in WordPress, please check the WP Codex, here: https://codex.wordpress.org/Function_Reference

If you are not aware the steps to do this thing, please consider hiring a freelancer/developer to do this thing for you, because we cannot provide custom work for the moment, sorry!

Hope this helps and let us know how it goes!

Thank you for the message!

gmaio
Participant
#0

Hi there,
I’m able to show an advertising banner (size 970×90) on my site homepage (please see http://screencast.com/t/ZlWAdGDr1sj) and I have obtained this behaviour by modifying the file “single.php” of my Newsmag child theme; I’ve added the following code snippet:


<div class="td-container">
        <div class="td-container-border">
                <div class="td-pb-row">
                <?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); ?>
                </div>
        </div>
</div>

The custom_ad_1 ad_box contains the Google DFP tag code.
What I’m trying to do now is to show the same banner under every category
top posts grid which don’t have this banner at moment (please see http://screencast.com/t/X4fBKGQs8). How could I get it?
Tnx a lot for any appreciated help

Giuseppe

Viewing 25 results - 701 through 725 (of 1,077 total)