- NewsmagAbove footer ads
- NewsmagSmart list ads
- NewsmagArticle ads
- NewsmagSidebar ads
- NewsmagHeader ads
- NewspaperHeader ads
- NewspaperSidebar ads
- NewspaperArticle Ad
- NewspaperPost template ads
- NewspaperAbove footer ads
Hi,
I’m trying to insert this shortcode into a custom post type (I’ve made a copy of single.php and renamed it to single-photo.php)
[vc_row][vc_column][vc_media_grid include="115125,115126,115127,115128,115129,115130"][/vc_column][/vc_row]
http://beta.virtualfestivals.com/photo/metallica-at-reading-festival-2015/ is the page in question. The code you see is what I output to make sure what I am doing is right. However when actually doing the code, I get an error in Google Chrome console
Code
<?php
$image_ids = get_field(‘photo_gallery’, false, false);
$shortcode = ‘[vc_row][vc_column][vc_media_grid include="' . implode(',', $image_ids) . '"][/vc_column][/vc_row]‘;
echo $shortcode ;
echo do_shortcode( $shortcode );
?>
Error
Uncaught Error: Syntax error, unrecognized expression: {‘status’:’Nothing found’}
Now, if I copy/paste that into the editor, it works but obviously this is not what I need as I need the IDs based off a custom field created using the ACF plugin
Any advice?
Hi
!. I am not sure what effect you want to obtain, please provide more specific details or an image pointing that effect.
2. Try this custom css in theme panel > custom css: http://screencast.com/t/KOlwsSjl
.page-nav-post a:last-child{
float: right;
}
3. Try this custom css: http://screencast.com/t/Bzfbw5YLr3Z
.td-icon-menu-right:before {
position: relative;
top: -4px;
left: 4px;
float: right;
}
.td-icon-menu-left:before {
position: relative;
right: 4px;
}
4. To display the pagination above the article button add you need to remove the the ad from post content: http://screencast.com/t/PWgzx852 then place the ad after the pagination function in posts’s template file, like this: http://screencast.com/t/pgCbyqSPF You can use the do_shortcode(' ') function and insert the ad shortcode from VC: http://screencast.com/t/W4SFKPnoShn – http://screencast.com/t/lqaJxdVdMee in every post template files coresponding for the post templetes used.
5. I found an image below your article bottom ad which create that blank space http://screencast.com/t/5RAdn7ht07Z I am not sure why appear there, but seems to be added by the above ads so you should check if the ad code it’s valid.
Thanks!
Hi,
@station The photon feature of jetpack’s plugin generates and serves a new, re-sized image based on img element’s width and height attributes” besides the one theme smart list adds to the page.
The jetpack photon feature can cause issues and while the theme works based on the same system (creates and serves/uses thumbnails for each uploaded image).
You can find more info about it here: http://jetpack.me/support/photon/
@unplug.tips You could place an ad sport banner basically anywhere using ad spot’s shortcode and the do_shortcode() function, you just need to edit the smart list file and add it like this: http://screencast.com/t/OiJeoRTe – http://screencast.com/t/6DuMWfc5F8 – http://screencast.com/t/NWw7IBHWbJ
I also checked this using the ad box shortcode inside smart list’s content and it worked fine.
The smart list have been designed to alter the first image you use on one item so it will use there a specific dimensions image thumb but to work around this you could add one specific first image which you can hide via css then add the second image which will be your banner or large image you need, like this: http://screencast.com/t/r2DtnTIpT – http://screencast.com/t/dNqkB65awsq – http://screencast.com/t/7XfROO8wN9
.td_smart_list_3 .td-item:nth-child(2) .td-sml3-display-image {
display: none;
}
Hope this helps!
Thanks
Hi,
@shafvan When you create a new ad using Adrotate you can add target="_blank" http://screencast.com/t/clzLPmX88
@PatWire The theme doesn’t have a header style like this and it doesn’t allows 2 header ads by default. You will need custom modifications for this for the header template that you use, so I suggest to hire someone to do this for you as we cannot offer custom work, sorry!
Just a tip if you want to modify the header style 1 you can add a container before the logo and use do_shortcode function to place a custom ad there. But you also need more css customization for that extra container and also to change the width of the header ad and logo.
Thanks!
I have used block 16 in single loop .php to display other posts from the same category.
Please how to change th query that display block 16 to ecxlude the actual post from displaying
http://www.panorama.com.al/basha-instat-i-qeveritar-pranoi-sot-zyrtarisht-krizen-rama/
I want in the right hand of website not to show the actual post but others from the same category
Where to find this $buffy .= $this->inner($this->td_query->posts, $td_column_number); to modify?
I use this shortcode in loop_single1
<?php echo do_shortcode(‘[td_block_16 limit=”5″ style=”” category_id=”‘.$rezi.'” category_ids=”” tag_slug=”” autors_id=”” installed_post_types=”” sort=”” limit=”5″ offset=”1″]’);?>
$rezi is post category but i want to exclude thispostid
Hello,
I tried this code and ads show it.
if (!is_page_template( 'nativead.php' )) {
$buffy .= '<div class="td-a-rec td-a-red-id-' . $spot_id . $align . ' '
. ((!empty($ad_array['disable_m'])) ? ' td-rec-hide-on-m' : '')
. ((!empty($ad_array['disable_tl'])) ? ' td-rec-hide-on-tl' : '')
. ((!empty($ad_array['disable_tp'])) ? ' td-rec-hide-on-tp' : '')
. ((!empty($ad_array['disable_p'])) ? ' td-rec-hide-on-p' : '')
. '">';
$buffy .= do_shortcode(stripslashes($ad_array['ad_code']));
$buffy .= '</div>';
}
Hi,
The theme doesn’t have an option to display to ads side by side for your post pages. You will need custom modifications in the code to achieve this, for example you can add the code in Theme Panel > Ads section in custom ad spots that you want yo use – http://screencast.com/t/LpPAVOv0 and use do_shortcode function in the post template that you use – http://screencast.com/t/ruQnSe1J and adjust the banners using custom css – http://screencast.com/t/eDF1dtDZ
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?>
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_2"]');?>
.td-a-rec-id-custom_ad_1, .td-a-rec-id-custom_ad_2 {
float: left;
margin: 0 0 20px 20px!important;
}
Please note that if you use adsense you have to change a with g – .td-g-rec-id-custom_ad_1, .td-g-rec-id-custom_ad_2
If you don’t know how to do it I suggest to hire a professional developer, as we cannot provide custom work, sorry! I have provided an example how it can be done(I did not take time customize them).
Thanks!
-
This reply was modified 10 years by
Alin [tagDiv].
Hi,
You can add your custom slider in the menu template that you use and add a condition to appear only for front page – http://screencast.com/t/VEIuCqkyZxy use something like this:
<?php if (is_front_page()) {
echo do_shortcode('your shortcode');
}?>
Thanks!
-
This reply was modified 10 years by
Alin [tagDiv].
Hi,
Do you want to add a custom ad on your post template to appear only on articles from specific category?
For example you can try something like this: http://screencast.com/t/bCu0neub This custom ad will be displayed only if the article is apart of new-look-2015 category in my example(please use the slug name in the code).
<?php if (in_category('category slug name')){
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
}?>
Or do you want articles ads to be displayed only on posts from specific category, please check this topic as reference – https://forum.tagdiv.com/topic/replace-adsense-code-of-ads-fields-in-a-category/ You will have to do the same just use in_category instead of !in_category.
Please note that the theme doesn’t have an option for this and I provide some example, so if you don’t have basic php experience I suggest to hire a freelancer to do this for you.
Thanks!
-
This reply was modified 10 years by
Alin [tagDiv].
Hi
If you want to add an ad only on pages you can use the do_shortcode(); function in the file corresponding with your page template: http://screencast.com/t/eqQ3bJzqnUva – http://screencast.com/t/euF6MIN9KlX To obtain the ad shortcode follow this link: http://screencast.com/t/oR7yzuBf
Let me know how it goes and provide more details if this is not what you mean.
Hi
You need to edit the page template used for homepage and add your shortcode add like here: http://screencast.com/t/JTiP5aHLa
<div class="td-pb-row td-pb-border-top">
<div class="td-pb-span12">
<?php
if (is_front_page()){
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
}
?>
</div>
</div>
To obtain the ad shortcode follow this link: http://screencast.com/t/oR7yzuBf – http://screencast.com/t/CHgwzp4p
Let me know how it goes.
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi,
Do you want to add another ad in the header? You can use do_shortcode function and display a custom ad in the header style that you use, for example – http://screencast.com/t/nFe3UMxj – http://screencast.com/t/4tFMXITS
<div class="td-container">
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?>
</div>
Thanks!
-
This reply was modified 10 years by
Alin [tagDiv].
Hi,
You can add the code like this – http://screencast.com/t/W7VY918Dr3Pw
$adcounter++;
if (is_category()) {
if ($adcounter == 2) {
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
}
elseif($adcounter == 4){
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_2"]');
}
}
Thanks!
Could i ask a quick question regarding the code below?
$adcounter = 0;
$adcounter++;
if (is_category()) {
if ($adcounter == 2 or $adcounter == 4) {
echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_1"]‘);
}
}
What amends would i need to make to this code so that i can have a ‘custom_ad_1’ space after the second post and a ‘custom_ad_2’ space after the forth post. So basically 2 different ad spaces (displaying different ads) on the category page?
Thanks
Hi
Make sure you insert this code in the post template that you’re using for the specific post, for this post http://unyawn.com/baby-elephant-plays-with-birds-will-melt-your-heart/ the required file it’s: single_template_5.php because you’re using the post template 5: http://screencast.com/t/naMXFav39u also you can check the plugin settings for more details: http://screencast.com/t/4Lcy7XH6OehN
echo do_shortcode('[fbcomments]');
Let me know how it goes!
Thanks!
Hi,
Unfortunately the theme doesn’t have such an option, you can achieve this only with custom modifications so I suggest to hire a freelancer to do this for you as we cannot provide custom work at this time, sorry! What can be done with the theme is to create a block(filter options, set infinite load pagination) and use do_shortcode function to display it in the post template that you use something like this – http://screencast.com/t/NKjGzgOKWin – http://screencast.com/t/lT1GsCBptd9m
Also you can try to find a plugin that allows infinite load on posts, but we did not tested any of these so I cannot make any recommendations.
Thanks!
Hi
You need to disable the auto positioning of the fb comments plugin from its settings then you can use the do_shortcode function to replace the theme’s comments template with FB comment plugin like here: http://screencast.com/t/wUW2XH0xSx
Notice that you need to edit the post template that you’re using. The result should be like here: http://screencast.com/t/ZGHPE2wxn
Let me know how it goes and if you still assistance on this!
Thanks
Hi,
You can use do_shortcode function to display it in the code:
<?php echo do_shortcode('[td_block_11 custom_title="Some Title" category_id="83" limit="5" td_filter_default_txt="All"]');?>
Thanks!
-
This reply was modified 10 years by
Alin [tagDiv].
Hi,
The theme allows shortcode (in post html editor or in the code) but you will have to create your warning message box using Visual Composer elements (for example in a text block), take the shortcode – http://screencast.com/t/FiPcJiIOjPSL and use do_shortcode function to add in the the template file(s) if you want to appear on all of your articles(as reference how this function is used) – https://forum.tagdiv.com/topic/move-the-bottom-article-ad-spot-below-the-share-bar/ or past only the shortcode in the post content – http://screencast.com/t/TzjVXW1Q4Ul
Thanks!
Hi,
Unfortunately the theme doesn’t have an option to place an ad(or more) on category page from Theme Panel, but we will consider this when a new ad system will be created.
You can place ads in category page using do_shortcode function if you want, just edit the loop.php file and follow this solutions:
https://forum.tagdiv.com/topic/how-can-add-horizontal-sidebar/#post-62563 – using this solution you can place ads after x posts
https://forum.tagdiv.com/topic/custom-ads-4/#post-62511 – you can add the ad after each post
Thanks!
Hi,
You will have to use fb plugin shortcode and place it after post pagination in template that you want – http://screencast.com/t/ZPlvKvUVtyg You can use do_shortcode() function.
<?php echo do_shortcode('plugin's shortcode');?>
Hope this helps!
-
This reply was modified 11 years by
Alin [tagDiv].
Hi
You can use the shortcode generated by the plugin in header ad box from theme panel, the theme will run do_shortcodes() function on the shortcode: https://forum.tagdiv.com/ads-system-full-guide/
Thanks!
Hi,
You can edit the post style that you use and add your code – http://screencast.com/t/89FWt0iP
As referece if you want to use do_shortcode function you can check this topic – https://forum.tagdiv.com/topic/move-the-bottom-article-ad-spot-below-the-share-bar/
Thanks!
Hi,
I guess that you have this issue because of quote – http://screencast.com/t/JiISewptJ try to add them again
' . do_shortcode('[userpro template=login]') . '
Thanks!
Hi,
Unfortunately the theme doesn’t have an option to place ads on category page, you will need to edit loop.php file and add it manually using do_shortcode() function, like this – http://screencast.com/t/o4OtAI3IJ
$adcounter = 0;
$adcounter++;
if (is_category()) {
if ($adcounter == 2 or $adcounter == 4) {
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
}
}
Result: http://screencast.com/t/fOlOSl9j1
If you want additional customizations and you don’t know how to do it, I suggest to get someone to help you as we cannot provide any type of custom work at this time, sorry!
Thanks!
-
This reply was modified 11 years by
Alin [tagDiv].