- 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,
there is a way to ALWAYS have the ticker on posts. But this one cannot be removed. You will have to edit the post template files and add the news ticker with a shortcode. You can insert it only on the templates you want.
You can use this code:
<?php echo do_shortcode('VISUAL COMPOSER SHORTCODE')?>
You first need to create the news ticker as you want it (edit it’s settings) in visual composer and then use the shortcode visual composer creates for the element. You can see it in classic mode and text mode. For example:
[td_block_trending_now]. (the code will look like so:
<?php echo do_shortcode('[td_block_trending_now]')?>)
Then you can use it in the desired template file: http://screencast.com/t/kgKgZYYsV or all of them if you wish to have it on all templates.
Depending on where you want the trending now to display inside the post you will need to insert the function in a certain place inside the file: http://screencast.com/t/1TYJUINUSVJ
Thank you!
Hello,
I used the code on my test site and it behaves as you described it. It disappears on click. Unfortunately i could not find the problem with it. You can maybe hire a freelancer to help you out on this one.
You can maybe add the search form like the one in the sidebar using the do_shortcode function. So you will have the search form in your header except there won’t be an icon, just the form itself.
Sorry for not being able to help but we are a small team and time does not allow us to provide any custom work at the moment.
Thank you!
Hello,
I see you used visual composer on posts. You can change the post template if you wish from the post settings.
You are placing the ad in visual composer inside the content. You cannot move it above the content from the files if you use it like this. What you can do is edit the default template (i assume that one is specified in the panel) and add your visual composer shortcode to the file: http://screencast.com/t/dRb58PAz4
code: <?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_2"]')?>
And then remove the ad box from your post as it will be picked up from the code you insert.
This will make every post that has the default template specified display the ad.
I hope this helps. If the default template is not specified in the panel you can apply the customization to the other loo-single files depending on the template specified. loop-single is the default template, loop-single-1 is template 1, so on and so forth.
Thank you!
Hi
You can use the do_shortcode function in the files corresponding with the post/page template that you’re using: http://screencast.com/t/gzwZfuAHz
echo do_shortcode('your shortcode ad');
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.
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi jstudio,
I understand what do you want to achieve. It is possible this thing, but is necessary to make some modification in the core file page-pagebuilder-latest.php. Also, you need to use do_shortcode to place the Big Grid 3 and Block 14 where you want.
This is the shortcode for Big Grid 3, Style 1 -> http://pastebin.com/myfFgjg5
This is the shortcode for Block 14 -> http://pastebin.com/wZm0NQDZ
After this, please place this code in php file, like this: http://screencast.com/t/arckqt2QY
Hope this helps and let us know how it goes!
Thank you!
Hi
First you need to edit ads.php file and add this code like here: http://screencast.com/t/fuxJVOF4Q1K
<div class="left-img">
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]')?>
</div>
<div class="rigth-img">
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_2"]')?>
</div>
Then add this css in theme panel > custom code > custom css:
.left-img, .rigth-img{
display: inline-block;
}
.td-header-ad-wrap{
height: auto!important;
}
You need to insert your ad code in custom ad 1 and custom ad 2 from theme panel: http://screencast.com/t/2IncMW3yH2 or if you want a different ad spot just change the shortcode from ads.php file. The result should be like here: http://screencast.com/t/sym9GLVY
Hope this help.
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hello,
It can be done only it will require custom modifications. Visual composer elements were not designed to work with category pages. You can add VC elements to the category page if you edit the core files either the template file or the top post file: http://screencast.com/t/aSHu4ciI and add a do_shortcode function
Every VC element creates a shortcode which you can see in text mode when editing a page. This shortcode can be used as the example above to force the page to display a block.
<?php echo do_shortcode('enter visual composer shortcode here');?>
It will require additional css to adjust the layout but this is the general idea of how it can be achieved.
Thank you!
Hi servedaily,
Yes, it is possible to display an image in that gray box. You can set this within Theme panel, as background image, like that: http://screencast.com/t/AtlvgnQib and the image will be the full background of the page. In this category style, header container are transparent and practically in this container you can see the background image. http://screencast.com/t/6x3ZUf4ZrQo
Also, another possibility for you, would be to use a bit of Css to make some customization. Please try the code below in your Theme panel->Custom Css area to fix the problem, like this: http://screencast.com/t/gtGlwFvufE
.td-category-header.td-image-gradient-style8 {
background-image: url('enter your URL image');
background-repeat: no-repeat;
}
Note: If you want to follow the above option, please use a background color/image (white color for example).
Every category has an custom class set to it. You can get this class by inspecting the category page with your browser inspector: http://screencast.com/t/5uS8nYlTc6u
For example mine is category 66. So i would add this to the beginning of the code like so:
.category-66 .td-category-header.td-image-gradient-style8 {
background-image: url('https://upload.wikimedia.org/wikipedia/commons/b/b5/Winnersh_Meadows_Trees.jpg');
background-repeat: no-repeat;
}
Now the code will only apply to that specific category. So if you need to use the code for another category you can simply copy and paste it and change the category number and the image.
To achieve custom headers for each category is not a simply task and this things are required custom work. You can use another category_top_posts_style (1,2,3,4,5,7) for each category you have and it is necessary to create some function in php and shortcode do_shortcode('Enter visual composer shortcodes here');?> in order to works fine. http://screencast.com/t/0DIS3Bzfxi
This is a complex task which requires lots of customization and if you’re not aware of the steps you need to take in this regard please consider hiring a developer or a freelancer to do this for you as we can’t offer customization services at the moment.
Hope this helps!
Thank you for your understanding!
Hello,
You will have to check the screen options to see if the homepage latest articles is ticked: http://screencast.com/t/AUo1q1edbG If it is. just deselect and select it again to refresh the option.
As for the pagebuilder under latest articles i cannot provide a quick solution for it. You could use the do_shortcode function to add content below the latest articles section:
For example use this code:
do_shortcode('Enter visual composer shortcodes here');?>
And add it here: http://screencast.com/t/dzWVQcfiD
This will force a VC block you set to it to display below latest articles.
I hope this helps
Thank you.
Hi,
@Healthills, please follow the same steps with single post and for category you have to use function below:
if ( ! in_category (array('cat-id','cat-id'))) { ?>
menu container
Here, http://screencast.com/t/dut2LkmLOy you can see how to find the category ID.
Please note that if you use this method and you have the sticky menu enabled: http://screencast.com/t/WwiZxvu5cfv the images won’t be displayed on that post because a js error.
@Hamzah, if you want to hide your main menu from particular page you have to use the page id that you want to hide.
Please try the code below in Theme panel->Custom Css area, like this: http://screencast.com/t/8hF2EXqv
.page-id-X .td-header-menu-wrap {
display:none;
}
Where X is your page ID. Here, http://screencast.com/t/S1qVQRbgFT you can see how to find the page ID.
For your second request, you can show different header ads in different page if you add some function in your ads.php file, like this: http://screencast.com/t/f7EsUBQq
if(is_page('page-id')){
echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');
}
else {
echo td_global_blocks::get_instance('td_block_ad_box')->render(array('spot_id' => 'header'));
}
?>
If you want to show header ads only to front page, you have to use is_front_page() function. The custom ad you can find it in Theme panel-Ads -> http://screencast.com/t/NujAwoIjF
Hope this helps and let us know how it goes!
Thanks!
Thanks for your fast answer Andrei,
On my actual theme, I manage to implement specific shortcodes to specific categories, following the method described here : http://codegrad.hub.ph/inserting-an-ad-between-paragraphs-in-a-wordpress-post/.
To do so, I add the following code on single.php :
********************************************************************
<?php
$paragraphAfter= 3; //shows the ad after paragraph 3
$content = apply_filters(‘the_content’, get_the_content());
$content = explode(“</p>”, $content);
for ($i = 0; $i <count($content); $i++) {
if ($i == $paragraphAfter) { ?>
<!– START OF AD CODE –>
<?php if ( in_category(‘category1’)) { ?>
<?php echo do_shortcode(‘[myshortcode1]’); ?>
<?php } elseif ( in_category(category2′)) { ?>
<?php echo do_shortcode(‘[myshortcode2]’); ?>
<?php } elseif ( in_category(‘category3’)) { ?>
<?php echo do_shortcode(‘[myshortcode3]’); ?>
<?php } else { ?>
<?php } ?>
<!– END OF AD CODE –>
<?php
}
echo $content[$i] . “</p>”;
} ?>
************************************************************************
Now I see that there is indeed a file named single.php on Newsmag, I would like to give it a try.
And my question is : where in all the code on single.php do I have to paste my custom code ?
Thanks in advanced.
Thanks you so much, all is much clearer now. We are getting there…
Adding image code: <?php echo do_shortcode('[vc_row][vc_column][vc_single_image image="223" img_size="full" css=".vc_custom_1447858280464{padding-top: 20px !important;padding-bottom: 20px !important;}"][/vc_column][/vc_row]');?>
How do I know what that image=”223″ is? Please if you can explain this.
Last thing, can I use the same procedure so all the single posts have that too? What .php file would I edit?
Hi,
If you want the first thing on the page to be the image, then you need to add your code in the category template files: http://screencast.com/t/Jhqe3L6t
<?php echo do_shortcode('[vc_row][vc_column][vc_single_image image="223" img_size="full" css=".vc_custom_1447858280464{padding-top: 20px !important;padding-bottom: 20px !important;}"][/vc_column][/vc_row]');?>
I just added a few more option to the image in visual composer like full size and padding.
Place it like so: http://screencast.com/t/gH5GgPEb
Just be advised that this will generate the same image on every category that uses this template.
result: http://screencast.com/t/jNBgRk8D
Thanks
-
This reply was modified 10 years by
Bogdan B..
Hello,
The latest articles title background is affected by the theme accent color: http://screencast.com/t/IpIEnNv3s3
For the ad you will need to edit the theme files to place the ad inside the page.
You can use this code: do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]');?>
and place it here: http://screencast.com/t/tY7rDT4F
Just make sure you have an ad placed in the custom ad 1 spot:http://screencast.com/t/OXINjrlHV
Thanks.
Hello,
I understand your request now. The example above only placed an image on the category page.
You will need to edit the top post files located here: http://screencast.com/t/5V35g4r7aO
Every file corresponds to a top post style you set from the theme panel: http://screencast.com/t/Koefd7FWIm
The shortcode i used was from a visual composer single image element. You can see visual composer shortcodes in text mode when editing a page. You can add a single image element in visual composer when editing a page and style it as you want: http://screencast.com/t/VBHhKVZuk2Oy -http://screencast.com/t/yv4uWDhsMH
Then after you are done with the image settings, you can enter text edit mode and copy the code created for the image to the files as i have shown you above using do_shortcode. You basically copy and paste a visual composer element which is responsive by default.
But the code will not set the feature image anywhere. It just places an image on the category page.
If you want to set the featured images on all 8000 post, besides the manual version, one thing you might try, if you already have an image “in the post” of some type, use the “auto post thumbnail pro” plugin which will automatically take first image from post (or from external site, if necessary) and then generate thumb and assign as “featured” image in every post.
Unfortunately there is no other option for this. You can maybe find a free plugin to do this as well.
I hope this helps
Thank you!
Hello,
Posts already have that option. The featured image does exactly that. Use a post template with a big featured image and you will have the desired effect: http://demo.tagdiv.com/newspaper/td-post-if-you-only-knew-how-much-your-relative-churn-rate-matters/
For the categories, you will need to modify the top post files in order to achieve your goal and you can add a condition to filter your categories and images: https://codex.wordpress.org/Function_Reference/is_category
You can also use a do_shortcode to place you images. For example:
The category number represents the category id. You can get it from here: http://screencast.com/t/OKsDtKVi3G5
<?php
if (is_category(13)) {
echo do_shortcode('[vc_row][vc_column][vc_single_image image="887"][/vc_column][/vc_row]')
}
elseif (is_category(14)){
echo do_shortcode('[vc_row][vc_column][vc_single_image image="886"][/vc_column][/vc_row]')
}
?>
You can add some padding to the image from visual composer from design options in order to make it fit the content.
result:http://screencast.com/t/pHkte6ztxf6t
I hope this helps
Thank you!
Hello,
In order to use a slider on a category page, you will have to edit the theme files. You can use the shortcode created by the plugin and use a do_shortcode function like so: http://screencast.com/t/VXWDBhAH4az
<?php echo do_shortcode ('slider shorcode here'); ?>
In order to link your slider to the most popular 7 days posts you will need custom modification and it unfortunately falls beyond the support we can offer. You will need to get a professional developer or freelancer to help you with this one.
Thank you for your message.
hello,
1) You can use the plugin shortcode to insert them manually in the post template you wish. Simply place the below code in the file that corresponds to the template you use. The default is loop_single, post template 1 is loop_single 1…etc: http://screencast.com/t/JUIC0QBt3s
<?php echo do_shortcode('[fbcomments]'); ?>
2) This issue is known and is on our list of fixes. Two playlist elements do not work on the same page.
Thank you!
Hi,
You try to add a php code in javascript that’s why is not working do_shortcode, unfortunately it is not easy to implement such of code and I cannot provide a solution, I suggest to hire a professional developer to do this for you, as this is not an easy task and we cannot provide custom work at this time, sorry!
Thanks!
We are working with a ad network (yyy) that allows to show google adsense (custom_ad_5) if they have no ads for us (xxx) to show. I tried to ad this code to our loop-single.php
<div id="ad-container"></div>
<script type="text/javascript">
function cvNoAdsCallback_xxx() {
document.getElementById('ad-container').innerHTML =
do_shortcode('[td_block_ad_box spot_id="custom_ad_5"]');
}
</script>
<script type="text/javascript" src="http://yyy/xxx/ad-container"></script>
Ok, to be honest, “do_shortcode” (bold row) is not a working command here, but I’m struggling a bit. Has anyone an idea? Thanks, loano
Hello,
I’m serving my ads through DFP and I followed the instructions on how to setup other ads because I plan on having the ads served locations not set by the theme.
Only issue is I need to call the shortcode in the loop-single.php template file which I did like this:
<?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_4"]');?>
I know it works for image ads because I have another custom spot with the ad being displayed but it doesn’t seem to work for non-adsense scripts. Below is the script I put in the custom ad settings of the theme panel.
<div id='single-bottom-custom-flex' class="td-pb-padding-side td-pb-border-top aligncenter">
<script type='text/javascript'>googletag.cmd.push(function() { googletag.display('single-bottom-custom-flex'); }); </script>
</div>
I can see the script in the source code yet the publisher console doesn’t recognize the unit. Hard coding the unit works but I need it to be done via theme panel’s custom ad. What’s preventing the custom ad from displaying the unit?
Hi Andrei,
I customized the code as you explained in the screenshots but after uploading the new ads.php my page didn’t load further than the header. Could you please be so kind to have a look at the code below?
Thank you so much!
__________
<?php
//@todo verifica daca ai ad daca nu pune clasa
$td_ad_array = td_util::get_option(‘td_ads’);
$td_no_ad_class = ”;
if(!empty($td_ad_array[‘header’])) {
if (empty($td_ad_array[‘header’][‘ad_code’])) {
$td_no_ad_class = ‘ td-ad’;
} else {
if (empty($td_ad_array[‘header’][‘disable_m’])) {
$td_no_ad_class .= ‘ td-ad-m’;
}
if (empty($td_ad_array[‘header’][‘disable_tp’])) {
$td_no_ad_class .= ‘ td-ad-tp’;
}
if (empty($td_ad_array[‘header’][‘disable_p’])) {
$td_no_ad_class .= ‘ td-ad-p’;
}
}
}
?>
<div class=”td-header-ad-wrap <?php echo $td_no_ad_class;?>”>
<?php
// show the header ad spot
if(is_front_page()) {
echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_4"]‘);
} else{
echo td_global_blocks::get_instance(‘td_block_ad_box’)->render(array(‘spot_id’ => ‘header’)); ?>
</div>
Hello,
The correct code would be this:
<?php echo do_shortcode('[gallery ids="364,327,302,223,149,21,23,16"]');?>
You have to insert the image id’s for your gallery.
You can create your gallery in visual mode and then switch to text mode and get the shortcode: http://screencast.com/t/BujdZhVK
This shortcode will work if placed on modules for example: http://screencast.com/t/7HvrsEavAgL
But this will generate the same gallery for every post displayed on that module and i don;t think this is the result you want. http://screencast.com/t/YwoaF1SjN Everywhere you place the code, the same gallery will appear over and over in all post excerpts.
Please provide more details to what you want to achieve.
Thank you!
-
This reply was modified 10 years by
Bogdan B..
hi bogdan,
thanks for the prompt reply.
i asked the same question in another wordpress forum, some of the advise given is to add this in the code.
<?php echo do_shortcode(“[gallery]“); ?>
i’ve tried in index.php but it doesn’t work. it it could be worked out , maybe i can give it a try.
thanks
Hello,
The video playlist does not show up when added with do_shortcode. A normal video player does. We will look into this and do some tests. I will add this issue on our list of fixes and updates. Until then you can use the visual editor to add a video playlists: http://screencast.com/t/e4eQwwhn8
Thank you!