Search Results for 'do_shortcode'

Results from the Forum
Andrei L.
tagDiv Member

Hi

You can use this code to display the add only after first image: http://screencast.com/t/1RpglB4U

if ($current_item_number == 1){
$buffy .= do_shortcode('[td_block_ad_box spot_id="content_inline"]');
}

Hope this helps.
Thanks!

Andrei L.
tagDiv Member

HI

To achieve that you need to edit the file corresponding with post template used and echo out there one of theme’s ad-spots. First you need to get ad’s shortcode from Visual Composer. Add an ad-box on a blank page, chose the desired ad-spot, press CLASSIC MODE button and copy the shortcode: http://screencast.com/t/CvyiAdvTo then paste it here: http://screencast.com/t/SAp89QNhaOEK

do_shortcode('[vc_row][vc_column][td_block_ad_box spot_id="custom_ad_1"][/vc_column][/vc_row]'); ?>

In above example I’ve used custom ad 1 on post template 1, but you can use any ad-spot from theme panel.
Thanks!

Bogdan B.
tagDiv Staff

Hi,

Unfortunately our theme does not allow the customization of the category pages beyond the category settings found here: http://screencast.com/t/mIburmESO49F You cannot use visual composer on category pages so there is no way to add elements from the theme settings.
You will have to edit the theme files and use a do_shortcode function. Please follow this guide for an example of how it can be done: https://forum.tagdiv.com/topic/adspace-in-category/

Thank you!

Bogdan B.
tagDiv Staff

Hello,

Our theme does not provide any category ad spots unfortunately. you will have to place a custom ad in the thee files if you require an ad on category pages.
You can use the ‘custom ad 1’ ad spot and then use this code:
<?php echo do_shortcode('[vc_row][vc_column][td_block_ad_box spot_id="custom_ad_1"][/vc_column][/vc_row]'); ?> and add it to this file like so: http://screencast.com/t/NblSUxUvrE

Thank you!

schindyguy
Participant
#0

I want to insert the content_inline adbox in smartlist 5

I found this thread https://forum.tagdiv.com/topic/need-help-about-block/#post-120048 where Caitlin showed how to add an adslot at the bottom of smartlist 5 by adding

$buffy .= do_shortcode('[td_block_ad_box spot_id="content_inline"]');

to /wp-content/themes/Newspaper/includes/smart_lists/td_smart_list_5.php

here: http://screencast.com/t/LTyumMT6

But that displays the adbox at the bottom of the entire smart list http://screencast.com/t/Zh2tB3lHL.

Where can I insert $buffy .= do_shortcode('[td_block_ad_box spot_id="content_inline"]'); in /wp-content/themes/Newspaper/includes/smart_lists/td_smart_list_5.php or another file so that the ad will only display after the first image item in smart list 5? For example on your smart list 5 demo: http://demo.tagdiv.com/newspaper/smart-list-style-5/ have the adbox appear only under the first imagel- please see http://screencast.com/t/pOMS6eKx0L45

Andrei L.
tagDiv Member

Hi

Yes it is possible. Follow this steps:
– revert back the changes I’ve indicated in my previous message.
– add the ad code in one of theme’s custom ad spots
– create a new page and add an ad-block on it, select in ad-block the custom ad-spot which hold ad’s code: http://screencast.com/t/T9QrVpFshiG
– press the CLASSIC MODE button and copy the shortcode: http://screencast.com/t/09LWoaPqeUA
– edit the file corresponding with header style used and add this code here: http://screencast.com/t/lqG1ycAYcKhttp://screencast.com/t/L4vk5oDVLPC

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

In above example I’ve used custom ad 1 but you can use any custom ad spot from theme panel.
Thanks!

Andrei L.
tagDiv Member

Hi

I assume that you want to display the slide on blog page where latest post are displayed. To achieve that you will need a bit of codeing as by default the theme does not have an option to edit blog page with Visual Composer. First create a new page and add on it the slide then press CLASSIC MODE button to switch in backend editor and copy the shortcode: http://screencast.com/t/ioelT32mjmm Next you need to edit index.php file and add this code here: http://screencast.com/t/BYFRp6bg

<?php echo do_shortcode('shortcode-goes-here') ?>

Hope this helps.
Thanks!

Bogdan B.
tagDiv Staff

Hello,

Unfortunately our theme has no such option. You can use visual composer on posts and add a block between post content, or add it in the theme files to show on each post with a do_shortcode function. https://developer.wordpress.org/reference/functions/do_shortcode/
And then use visual composer shortcodes to add content to posts template files. You can fiond the post template files in the main root folder of the theme: http://screencast.com/t/cvDnyotuhS
I hope this helps.

Thank you!

Catalin
tagDiv Staff

Salut,

Am inspectat site-ul tau si am vazut blocul despre care este vorba. Din pacate, eu nu pot sa stiu ce fel de setari ai aplicat pentru acest tip de bloc. Ce poti face este sa te uiti in Block Settings in back-end si sa setezi blocul dupa aceleasi setari si pe pagina cealalta unde doresti sa afisezi acest block. Din ce vad, tu ti-ai facut ceva customizari separate la blocuri deoarece apar clase diferite, dupa cum se poate vedea aici -> http://screencast.com/t/Aojr8xKp nu? No nu avem nici o clasa care se termina in _go ??
Pentru mai multe informati despre cum poti sa iti setezi un block, te rog sa verifici documentatia noastra aici -> https://forum.tagdiv.com/block-settings-tutorial/
Pentru a doua intrebare, daca vrei sa afisezi ceva content dupa continutul paginii de categorie, tu trebuie sa modifici fisierul category.php si sa adaugi codul cu do_shortcode in aceasta regiune -> http://screencast.com/t/lafvDBVjA6mO in functie de ce caz folosesti, referitor la sidebar.

O zi faina in continuare!

Andrei L.
tagDiv Member

Hi

This is possible only by editing theme’s core files. Basically you can use do_shortcode function in tag.php file to echo out the any shortcode. Here is an example: http://screencast.com/t/s57r7YsPsc7http://screencast.com/t/7XBJjINJwahttp://screencast.com/t/Mf12GLqR

    <?php
    if (is_tag('tag1')) {
        echo do_shortcode('[vc_row][vc_column][td_block_14 category_id="33" limit="3"][/vc_column][/vc_row]');
    }
    ?>

I’ve used is_tag() function to display this shortcode only on tag1 tag page. You can remove the condition if you want the same shortcode on all tag pages or you can extend it if you a specific shortcode for each tag page. Just pass tag’s name as a parameter for is_tag() function.

Hope this helps.
Thanks!

stefan-2
tagDiv Member

Inca o intrebare : incerc sa modific td_category_template_7.php, vreau sa adaug un bloc prin do_shortcode (dupa sfatul tau). Problema este ca blocul se afiseaza inainte de lista de posturi, si nu dupa ele, cum as dori.

                    
<h1 itemprop="name" class="entry-title td-page-title"><?php echo parent::get_title(); ?></h1>

                    <?php echo parent::get_description(); ?>

                </div>

	            <div class="td-pulldown-container"><?php echo parent::get_pull_down(); ?></div>

            </div>

        </div>

	<?php echo do_shortcode('[vc_row][vc_column][td_block_big_grid_5_go td_grid_style="td-grid-style-5" installed_post_types="page"][td_block_big_grid_4 installed_post_types="page"][/vc_column][/vc_row]'); ?>
  • This reply was modified 10 years by Catalin.
Bogdan B.
tagDiv Staff

Hello,

Unfortunately if you remove the search button and replace it with a search box, the live search will not work anymore. You can use this code:
<?php echo do_shortcode('[vc_wp_search]'); ?>
And add it like so: http://screencast.com/t/flOqdCTcZ
It will require a bit of css for further positioning though.

Thank you!

BastianWeber
tagDiv Member

Hi Bodgan,

thanks for your reply and sorry for my late response.

I located the search part in the header-menu.php. Is it possible for you to show me in your second screenshot, how I would replace the icon with the default wp search element using the do_shortcode function? I’m not familiar with coding I’m afraid, and I wouldn’t know what to do.

Also: Isn’t it also possible to simply use the code from the actual search bar from the newspaper theme somehow and replace it with the icon so we just get rid of the step “clicking the icon” ?

Thank you so much.

P.S. the website is http://www.bastian-weber.com (in case it helps)

Bogdan B.
tagDiv Staff

Hello,
It can be done only with customization. The theme does not have any such setting. Sorry. You can replace the search icon with a default wp search element and use a do_shortcode function https://developer.wordpress.org/reference/functions/do_shortcode/ inside the header menu file: http://screencast.com/t/L5Hcu8H5i
Thank you!

ericboland93
Participant
#0

I would like to have some VC stuff in the header as I would like to enable and disable a Breaking News Box across the whole website.

Here’s the code I have place in the single page

<?php echo do_shortcode("[vc_row][vc_column][vc_message color="alert-info"]Welcome to WNewsNetwork's New Website. Read the latest Social News on Your Social News Network. If you don't have a WNewsNetworks Account, please signup just below.[/vc_message]"); ?>
<?php echo do_shortcode("[td_block_trending_now style="style2" limit="3"]"); ?>
<?php echo do_shortcode("[vc_message message_box_style="solid" style="square" message_box_color="black" icon_fontawesome="fa fa-globe" css=".vc_custom_1470441776291{background-color: #000000 !important;}"]
<h1><span style="color: #ffffff;">#WNNBreakingExample Breaking News Story</span></h1>
[/vc_message]"); ?>

But I’m having issues with a php error on line 9.

Andrei L.
tagDiv Member

HI

1. This could be achieved by editing theme’s code. Basically you need to edit the file which generate the header style used and use do_shortcode function to echo out the shortcode which generate that custom menu. http://screencast.com/t/GfnuK6fiYw

2. By default the category page cannot be customized to much, the post order if fixed. However you can use a code snippet to generate a custom one using Visual Composer. Here is an example:
– create a new page and add on blocks which will display all desired posts for the custom category page. You can use all available filters for blocks.
– create a new category page, ex: custom category
– edit category.php file and add a contrition like here: http://screencast.com/t/gxZTyMpw
For ,ore detaisl about is_category function please check this link: https://developer.wordpress.org/reference/functions/is_category/

This is just a basic example but could be customized in many different ways. Note that you may need some additional css for page’s layout.

I hope this helps.
Thanks!

silviarehn
tagDiv Member

Hello Andrei, it works.
I use the easy-fb-like-box plugin and the code:

<center><?php echo do_shortcode(‘[easy-fb-like-box url=”https://www.facebook.com/MagazineFeminina” width=”550″ height=”300″ faces=”true” hidecover=”false” posts=”false”]’); ?></center><BR>

Thank you!

Catalin
tagDiv Staff

Hello Achimzwo,

If you want to exclude the code of Revolution Slider for your Landing Page, please notice that you will have to add some conditions through code, in header-style-10.php where you have added the shortcode for Revolution Slider. As a basic example, you can use this -> if ( ! is_page(page_id)){ echo do_shortcode('shortcode'); } For more references about this function, please refer here -> https://developer.wordpress.org/reference/functions/is_page/
If you are not aware of the steps in this regard, please consider hiring a freelancer/developer to help you because we cannot provide custom work at the moment, sorry!

Thanks.

Catalin
tagDiv Staff

Hello crazydiver,

Please notice that you can use the do_shortcode method for adding your Custom Ad 1 where you want using this snippet of the code -> echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]'); Also, please ensure that you have add your add code in Custom Ad 1 in order to achieve as you wish.

Thanks for your understanding!

crazydiver
tagDiv Member

Hello Catalin,

As always thanks. However, I’m already using inline ads.

I have some posts that are long, and some with only five paragraphs or less. Using inline ads doesn’t make it practical as it sets all ads to appear within a set number of paragraphs for all my posts.

This is why, I want to manually add a short code to these post instead of using the inline ad option.

I read the documentation you gave and the last part got my interest:

[shortcodes] – the spot will run do_shortcode() on the ad. Using shortcodes you can add adRotate ads to that spot.

How do you yo do this exactly?

Catalin
tagDiv Staff

Hello pabu1999,

If you want to do this, please notice that you will have to insert them manually, using the do_shortcode method. If you want to add some ads on your category pages, please refer to this topic here -> https://forum.tagdiv.com/topic/ads-on-page-category/ because there you will find the method which you will have to follow to achieve as you wish.

Thanks for the message!

Andrei L.
tagDiv Member

Hi

Yes this is possible by editing comments.php like here: http://screencast.com/t/zplmOTxrgNdq

<?php
echo do_shortcode('[widget-shortcode-goes-here]');
?>

Just paste the shortcode inside do_shortcode() function and the widget will be displayed bellow comments section.
Thanks!

Bogdan B.
tagDiv Staff

Hi,
I’m not sure what header code you are looking for. You can use the do_shortcode function to render shortcodes on the front-end. if you want to show an ad, you can use a visual composer ad box element filtered to show a custom ad. You get the shortcode for any element on pages in classic mode-> test mode like so: http://screencast.com/t/EWo5JAccNh
I hope this helps.
Thank you!

Bogdan B.
tagDiv Staff

Hi
You can edit the post template files and use a do_shortcode function like this topic suggests: https://forum.tagdiv.com/topic/how-to-add-a-widget-before-related-posts-section-on-articles/
Thank you!

CooleRnax
Participant
#0

I want to add a popup to all pages of the site with delay, there are several options

Post tag [shortcode]
[pro_ad_display_adzone id=”1237″ ajax_load=”1″ popup=”1″ cookie=”1″ delay=”10″ nobg=”1″ popup_bg=”#7f7f7f”]

Template tag
<?php echo do_shortcode(“[pro_ad_display_adzone id=’1237′ ajax_load=’1′ popup=’1′ cookie=’1′ delay=’10’ nobg=’1′ popup_bg=’#7f7f7f’]”); ?>

Where should i put this code? I tryed putting this into custom code section. But it didn’t worked.

Viewing 25 results - 451 through 475 (of 1,077 total)