No search results were found in Documentation!
Can you provide me any solution on this ??
or steps to be followed to achieve this ??
let me simplify my concern once again with simple words
on each category page there is loop running which fetch the articles in a template chosen from the theme panel->categories
so i want a normal ad unit in between the loop for every certain posts number
for eg a category shows 20 posts in listing then after every 4 posts there will be an ad shown.
Eu uso o pagebuilder + latest articles + pagination e post loop 13. Eu preciso adicionar o anuncio no meio dos posts do loop 13
I use the page builder + + pagination latest articles and post loop 13. I need to add the announcement in the middle of the loop 13 posts
Hello firetoss,
If you want to add the tab on single posts, you can do it if you are using the do_shortcode method. First of all, you have to create the code from Visual Composer, like this -> http://screencast.com/t/nZBNCZx9Y and then you have to create this code ->
<?php echo do_shortcode('[vc_tta_tabs][vc_tta_section title="Tab 1" tab_id="1461047600033-9a2e045c-8d40"][/vc_tta_section][vc_tta_section title="Tab 2" tab_id="1461047600063-077fb1e5-cf44"][/vc_tta_section][/vc_tta_tabs]');?>
For example , if you are using the post template style 1, you have to add this snippet of the code in loop-single-1.php, like this -> http://screencast.com/t/J9hVGp0iAIVd and the result you should see here -> http://screencast.com/t/HVY46AsrhEsE
Please notice that you have to customize your tab as you wish, depending on what you want to show in this tab. These change would be made from Visual Composer.
Hope this helps!
Thank you for your understanding!
I’d like to display more than one category name/link in the meta info of each post in Block 12, like in the single posts where you can see more than one. Is there some code from the single post loop that can be re-used to do this in td_module_mx11.php? I don’t want to choose a primary category, I want to be able to display at least two.
http://thekineticist.com/2016/04/15/art-dance-collaboration-in-philadelphia/
Single post > Multiple categories displayed here
Thanks.
Rachel
Hi
Basically a custom post type it’s assigned to a custom taxonomy. That is a point of a custom post type, to have an additional way to sort thing in wordpress. The categories are default wp-taxonomies which are designed to display only wp’s default posts types. To change that you’ll need to modify the query for category pages and send your custom post types as a parameter. The query for category pages it’s made by loop.php file so you have to make some changes in that file in order to achieve your goal.
In td_data_source.php are made all queries for theme’s blocks. That file dos not generate content for pages like category page, archive page etc. It generate the query for each theme’s block.
Thanks!
Hi — We are having an issue with the default / auto-generated category pages (category.php, I believe), where the first 10 posts appear just fine, but then after that the site loops those same 10 posts, as opposed to publishing the rest in the category.
So, only the first 10 posts of each category are showing (then repeating), and none of the older posts in that category are appearing.
Our staging site is: http://littledigitalco.biz/publiceye
As an example, you can see this category page: http://littledigitalco.biz/publiceye/category/topics/criminal-justice/
Or this category page: http://littledigitalco.biz/publiceye/category/featured-investigations/child-fatalities/
After the first 10, they just repeat — but they should be showing the rest of the posts that are published under that category.
Thanks!
Abi
Hi,
I’m creating a custom home page using visual composer. I don’t want the posts loop to appear on that page. There is no option for disabling it in the posts loop sittings tap.
We are using custom taxonomy for classification of our content. For this, we wanted to add custom taxonomy to post templates where category is shown on the top, above headline.
In post templates loop-single.php, loop-single-1.php, loop-single-5.php, loop-single-9.php, loop-single-1.php we found the following line of code
<?php echo $td_mod_single->get_category(); ?>
This helped us to know where to add our code. However, wut we are unable to find this in other post templates so we can’t understand from where are the other posts templates getting the category.
Could you tell us?
Salut!
1)The footer widgets are found here: http://screencast.com/t/E8V4SkYU9A6 If youhave not modified the theme files, then you can remove your widgets from there.
2)you can remove the space using this css code:
.td_block_trending_now.td_block_wrap{
padding-bottom:0!important;
}
.test{
margin-bottom: 0!important;
}
.td-main-page-wrap{
padding-top:20px!important
}
(as a side-note: you have a container in there with a class called ‘test’ that also created white space)
3)To display ads between posts on a specific category page are required lots of customizations and also many tests in order to achieve the desired result. Basically you need to edit the loop for that specific category page such that to display a specific ad-spot after a given number of posts.
All this customizations falls beyond the support can offer you so if you’re not aware of the steps you need to take in this regard please consider hiring a freelancer to do this for you as we can’t offer custom services at the moment.
4)If you want to remove the ad on post style 1, you can do it from here: http://screencast.com/t/RRXPmQTF
For the top ad, it will be a bit trickier as the top ad displays on all post templates so you need to ad a few conditions to the code where the ad is being created. Please use this code: http://pastebin.com/b5ZWGEhf
and replace this part here: http://screencast.com/t/uiYhFyE0rF
This will disable the article top ad for post style 1 and now you can ad a custom ad in the top of the file with a do_shortcode function:
And add it in the file like so: http://screencast.com/t/sKAM9mtVmj
Now if you do not have an article top ad, the text will fill the white space besides the featured image.
Thanks.
Hi
To display ads between posts on a specific category page are required lots of customizations and also many tests in order to achieve the desired result. Basically you need to edit the loop for that specific category page such that to display a specific ad-spot after a given number of posts.
All this customizations falls beyond the support can offer you so if you’re not aware of the steps you need to take in this regard please consider hiring a freelancer to do this for you as we can’t offer custom services at the moment.
Thanks for your understanding.
Hello firetoss,
Depending on where exactly you want to show your spots. I suppose that you want to display on your posts and for achieving this you have to introduce the code in loop-single template corresponding to your post-temple used by you, like this -> http://screencast.com/t/KK5RI7fiuY
Hope this helps!
If is not what you mean, please provide more details so I will be able to provide more accurate response.
Thanks.
Hello emil86,
Unfortunately, our theme does not have such an option for what you want but you can achieve that only for coding. If you want to have this feature on all posts above post title, you have to use do_shortcode method to implement this. For example, if you are using post template 1, you have to add the code below in loop-single-1.php, like this -> http://screencast.com/t/V6Cf3Yqsao
The code is ->
<?php echo do_shortcode('[td_block_trending_now]'); ?>
Thanks.
Hello,
Custom post types use the default template as the global option. There is no option to change it however as the post styles were only created for posts only. You can edit the single.php and loop-single.php files if you want but this will also affect posts that use the default template.
Thank you!
Hello ppcker,
If you want to add a universal text below for all your posts, you have to use do_shortcode method and add this for all corresponding file to your post template used by you. First of all, you have to edit the text block with your desired text, like this -> http://screencast.com/t/sIdwp5aT -> http://screencast.com/t/f9SOma8H and then you have to create this code <?php echo do_shortcode('[vc_column][vc_column_text]INSERT YOUR DESIRED TEXT HERE.[/vc_column_text][/vc_column]'); ?> which you have to place in the code. For example, if I sue the post template style 1, you have to edit the loop-single-1.php, like this -> http://screencast.com/t/38R9rjgt and the result you should see here -> http://screencast.com/t/ka2l2IlwM
Hope this helps and let us know how it goes!
Thank you for the message!
I am new to this Newsmag theme, anytime I post any small content it displays on home page and news page and category page. I don’t want that duplicate post display flying everywhere. I don’t know any thing about loop code since my searching on google shows I can change that, I still cannot not after spending frustrating hours finding a solution to this problem. I want specific posts to go to specific pages, I do not want video to go to home page. who can help me with this problem of duplicate post display? I will appreciate you practical assistance. Thanks in advance
Hi,
I have an event post type. In addition, I have custom fields. I would like to search these fields.
Normally, this would be ok but unsure how to do it on Newsmag. How do I amend the search facility for a specific post type so it filters what people choose? This is what I have so far but I would like to expand the current search facility
Functions.php
function template_chooser($template)
{
global $wp_query;
$post_type = get_query_var('post_type');
if( $wp_query->is_search && $post_type == 'event' )
{
return locate_template('event-search.php'); // redirect to archive-search.php
}
return $template;
}
add_filter('template_include', 'template_chooser');
add_filter( 'posts_where', 'wpse18703_posts_where', 10, 2 );
function wpse18703_posts_where( $where, &$wp_query )
{
global $wpdb;
if ( $wpse18703_title = $wp_query->get( 'wpse18703_title' ) ) {
$where .= ' AND ' . $wpdb->posts . '.post_title LIKE \'' . $wpdb->esc_like( $wpse18703_title ) . '%\'';
}
return $where;
}
Event-search.php
<?php
/* Template Name: Custom Search */
get_header(); ?>
<?php
// args
$args = array(
'numberposts' => -1,
'wpse18703_title' => 'reading festival',
'post_type' => 'event'
);
// query
$the_query = new WP_Query( $args );
//echo "Last SQL-Query: {$the_query->request}";
?>
<?php if( $the_query->have_posts() ): ?>
<ul>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<li>
<a>">
<?php the_title(); ?>
</a>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
<?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
I look within loop.php but nothing there to help unfortunately. Basically – how do I add a filter to the search based on a URL parameter?
Hi,
I want to place an custom ad on posts between social sharing and related post on my site (http://soutaoboa.com/as-vezes-um-carinho-cai-tao-bem/). But this one ad should only be visible to mobile visitors.
So:
I have a custom ad 1 and the code is in place (not adsense);
Did a call for the shortcode:
<?php echo do_shortcode(‘[td_block_ad_box spot_id="custom_ad_1"]‘)?> on loop-single file;
On the style.css I have:
@media only screen and (max-width: 767px) {
.td-a-rec-id-custom_ad_1{
position:center!important;
};
The problem is that the ad is there but visible to everyone.
What I’m doing wrong?
Thanks
P.S. I have a child theme.
Make a custom post type, add the text to custom single post template; then on sponsored posts use that custom post type of “sponsored” … kind of need to use plugin, or “roll your own”…
Trick is that a lot of news portals are against the concept, while others are 100% sponsored spam content; and then the ones in the middle are setting it up for themselves based on what they are trying to do.
You also have to deal with making the sponsored post ‘sticky’ on front page if in middle of organic content stream, which is a bit like injecting ad in middle of a query loop for all posts …
So – might be plugin to do this, but CPTs are most likely method.
(( I don’t work here … ))
hi,
Custom post type posts not show in category page but i see post in taxonomy page, filter page and menu.
i dont find category page loop chance i try this replace this code did not work well enough
// Old Code
<?php locate_template(‘loop.php’, true);?>
// New Code
<?php
// WP_Query arguments
$args = array (
‘post_type’ => array( ‘post’, ‘galeri’),
‘post_status’ => array( ‘publish’),
‘cat’ => $cur_cat_id,
‘posts_per_page’ => ’10’,
);
// The Query
$query = new WP_Query( $args );
// The Loop
if ( $query->have_posts() ) {
while ( $query->have_posts() ) {
$query->the_post();
echo ‘<div class=”yenikategori”>
<div class=”td-block-span6″>
<div class=”td_module_1 td_module_wrap td-animation-stack”>
<div class=”td-module-image”>
<div class=”td-module-thumb”>’,
‘‘,
get_the_post_thumbnail( $post_id, array( 300, 160) ),
‘
</div>’;
‘cat_slug.'” class=”td-post-category”>’.$category[0]->cat_name.’</div>’;
echo ‘ <h3 class=”entry-title td-module-title”>’;
echo ‘ ‘.get_the_title( $id ).’
</h3>’;
echo ‘<div class=”td-module-meta-info”>
<div class=”td-post-date”>’;
echo ‘<time class=”entry-date updated td-module-date” >’.get_the_date().'</time>’;
echo ‘</div>
</div>
</div>
</div>
</div>
</div>’;
}
} else {
// no posts found
}
// Restore original Post Data
wp_reset_postdata();
echo ‘</div>’;
?>
Hi Andrei,
1. Here is the link for your reference: Hello Tesla
I turned enabled category tags for all modules and it didn’t change anything.
2. I am not using any blocks to display these posts on the home page, so I am not sure how to use infinite pagination. I have select “All Categories” in “Post Loop Setting”.
I am not using any blocks here because it doesn’t show right-hand side bar when I use blocks for that.
Thanks again
-
This reply was modified 10 years by
cnetplanet.
-
This reply was modified 10 years by
cnetplanet.
Hello,
Unfortunately, the subtitle field is not available in the Visual Composer. The subtitle is for posts only. It’s a field that can be filled on every post, but this option is not available in the Visual composer. Our modules and blocks do not display the subtitle by default. It can be done however by editing the theme files. if you want to show subtitles on the homepage in the theme’s blocks you can follow this topic to see how it can be done: https://forum.tagdiv.com/topic/output-subtitle-in-blog-loop/
Thank you!
Hi
I am not sure where you want to display the parent category but there are two situations:
– if you want to display it on posts then you will need a new function in td_module_single_base.php file: http://screencast.com/t/0gBPfJtP7 then call the function in loop file corresponding with the post template used: http://screencast.com/t/N9ZTjVYB The result will be like here: http://screencast.com/t/mIh5zDfdE
<?php echo $td_mod_single->get_parent_category(); ?>
– if you want to display it on modules the file that must be edited is td_module.php: http://screencast.com/t/5oCbVAjEc then call the function on each module where you want to display the parent category: http://screencast.com/t/ZmCrrUDeNY6 – http://screencast.com/t/jgJDfRbaS
<?php echo $this->get_parent_category(); ?>
Here is the code of the function used as example: http://pastebin.com/1vHDfyJq
Note that this is just a basic example but can be used in many different way depending by the desired result. I didn’t applied any style on it, but this can also e done using css class in side php code. You can use others functions from the theme as example but please consider that this customizations require good coding skills and also many tests in order to work fine. Unfortunately time does not allow us to provide any custom services at the moment so if you still need guidance on this or 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.
Thanks!
-
This reply was modified 10 years by
Andrei L..
Hi,
Please see this post, it renders everything right.
http://www.moretify.com/2015/11/%E4%BD%A0%E7%9F%A5%E9%81%93%E6%9C%9D%E9%B2%9C%E5%A5%B3%E4%B8%BA%E4%BD%95%E4%BB%8E%E6%9D%A5%E4%B8%8D%E7%A9%BF%E8%A3%A4%E5%AD%90%EF%BC%81%E7%9C%9F%E7%9B%B8%E8%AE%A9%E6%88%91%E5%82%BB%E7%9C%BC/
But, other posts not. This is weird because i all the elements are added in loop-single.php, header.php and footer.php
Basically these are the code which i added. Usually i will draft in Notepad++ and move into theme panel by copy and paste.
If necessary, i will provide the admin login for you to check, thanks.
-
This reply was modified 10 years by
Bogdan B..
Hello,
Unfortunately the subtitle field is not available in visual composer. the subtitle is for posts only. It’s a filed that can be filled on every post, but this option is not available in visual composer. Our modules and blocks do not display the subtitle by default. It can be done however by editing the theme files. if you want to show subtitles on the homepage in the theme’s blocks you can follow this topic to see how it can be done: https://forum.tagdiv.com/topic/output-subtitle-in-blog-loop/
Thank you!
In the theme panel I have bottom sharing on posts enabled which is triggered in wp-content/themes/Newspaper/loop-single.php with this
<?php echo $td_mod_single->get_social_sharing_bottom();?>
I tried cutting that code from loop-single.php and putting it in /themes/Newspaper/includes/smart_lists/td_smart_list_7.php below the ad for smart list 7 and above the bottom pagination but it didnt work http://screencast.com/t/toCketvuSq
How can I get the tagdiv sharing to load above the pagination on smart list 7?
Is there a shortcode I can add to td_smart_list_7.php ?
Thanks!!!