- NewspaperPosts Loop Element
- NewspaperFlex Block Builder and Flex Loop Builder
- Apitd_api_category_top_posts_style::update_key
- Apitd_api_category_top_posts_style::update
- Apitd_api_category_top_posts_style::add
- NewspaperBookmark – Save For Later
- NewspaperModules Builder in Newspaper Theme
- NewspaperFilters and sorting for taxonomies
- NewsmagPage templates
- NewspaperPage templates
- NewspaperSmart Sidebar
- NewspaperChild Theme Support
- ApiAPI – Thumbnail – Introduction
- ApiAPI – Category top section style – Introduction
Hello,
If you want to add custom code to posts, you will have to edit every post template file that you use on your post. Every post template has 2 files a single.php and a loop-single.php: http://screencast.com/t/MhmQWg4ZCdBY
Thank you!
Hi
Unfortunately this can be achieved only by modifying the query for the author page. The query it’s made in loop.php file: http://screencast.com/t/qXmAPYgkXA8
This is a complex task which involve many customizations in theme files and unfortunately I can’t provide a solution now. I found here some information which may help you to customize the query: https://codex.wordpress.org/Function_Reference/query_posts
Please consider that this is a complex task which require advanced coding skills, also many customization and tests. If you can’t do this by yourself my advice is to look for someone which can help you with this or hire a freelancer to do it for you as we can’t offer any type of custom work at the moment.
Thanks!
Hi
The theme uses the WordPress default query for custom taxonomies which it’s made in loop.php file here: http://screencast.com/t/vGXPifsf31
The query from td_data_source.php affect only theme’s blocks, or the content from Visual Composer editor. To affect the content displayed by the loop you have to write a custom query. Depending where you want to display posts from custom taxonomy the file differs. You can make a new page template with a custom query where only posts from one or more taxonomy are displayed.
Please note that working with custom taxonomies in WordPress require good coding skills and also many customizations in theme files. Here I found some information which may help you in this regard:
– https://codex.wordpress.org/Class_Reference/WP_Query
– http://www.wpbeginner.com/wp-tutorials/create-custom-taxonomies-wordpress/
– http://code.tutsplus.com/tutorials/taxonomy-archives-list-posts-by-taxonomys-terms–cms-20045
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!
hello,
i use newsmag theme on global.minutenews.fr and i want to change the order of the homepage loop with this custom filter. i use the template VC + last post + pagination but i tried with all template and it’s not working because it seems it’s not the main query .
here is my filter :
// Alter the homepage Query to order by sharecount and date
function hp_pre_get_posts( $query ) {
global $query_string;
// do not modify queries in the admin
if ( is_home() && $query->is_main_query() ) {
$query->set(‘orderby’, ‘date meta_value_num’);
$query->set(‘meta_key’, ‘socialcount_total’);
$query->set(‘order’, ‘DESC’);
}
if ( is_category() && $query->is_main_query() ) {
$query->set(‘orderby’, ‘date meta_value_num’);
$query->set(‘meta_key’, ‘socialcount_total’);
$query->set(‘order’, ‘DESC’);
}
// return
return $query;
}
add_action(‘pre_get_posts’, ‘hp_pre_get_posts’);
can you help me ?
We recently migrated our site, http://www.koimoi.com, to your Newsmag theme, and love the new layout.
We’re hosted on Pagely.
We’ve been noticing alot of server errors on Google Webmaster tools, where lots of URLs were throwing up 500 and 502 errors. On checking with Pagely, this is what they pointed out :-
1) All the 502s / 500s are of the format :
http://www.koimoi.com/?attachment_id=264104?aid=&iid=2
One problem is that the URL is invalid 264104? instead of 264104&.
2) If we switch the url to
http://www.koimoi.com/?attachment_id=264104, it very slowly redirects to http://www.koimoi.com/sunny-leone-sachiin-joshi-promote-jackpot-in-bangalore-4/, which fails with a 502 error.
Pagely believes the problem is to do with an infinite loop triggered at “wp-content/themes/Newsmag/attachment.php” line 47.
What is the purpose of attachment.php?
Reading other posts on your pages, attachment_id=XXXX is typically used to reference a image in the media gallery, and pull out its’ parent page. Is that correct ? How do we stop these URLs from being crawled ?
Would it be possible to share our copy of attachment.php for your review?
Hello Corrado,
First of all, thank you for your message.
As I said you above, the header.php is the single file where is created our theme header. This file calls the header both on pages and on posts and if you want to add the HTML tag you must insert between the head tag
… as you can see in our backend here -> http://screencast.com/t/vnEFAqG8eKbT and for each template file the header will be called with get_header() function. As you can see here, the loop single(1,2,3,…) and single template(1,2,3…) files are used to create the content for posts and page.php, page-pagebuilder-latest.php, page-pagebuilder-title.php to create the content for pages and will call the same header, like this -> http://screencast.com/t/JwrY6oDHPQ -> http://screencast.com/t/WgWD3rL2ZX Also, if you want to do some changes in header style, you have to change this kind of files, according to header style used by you -> http://screencast.com/t/CiSOLjAPHqI hope that I have managed to answer for all your queries related to this topic.
Thank you for your understanding!
Hi, all.
I will email Lucian/Radu the example stuff.
But quick overview…. FB has their own generated code you can implement, which can be responsive and this method basically replaces their old defunct WP plugin for FB comments.
Example in action on IMDB news items:
http://www.imdb.com/news/ni59489163
But, basically you go here:
https://developers.facebook.com/docs/plugins/comments
You use the “configurator” to specify a website, and width such as “100%” for responsive divs.
Assuming your site is already setup for ‘apps’ in your FB developer/user account, you would on above page click the ‘get code’ and then it will ask you to assign to one of your sites (if more than one), and you have a block of code to use with a WP theme.
Block ONE, looks like this and would go after the body tag on POST template:
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=XXXXXX";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
then block two would either replace the comments box includes file, or simply be pasted into the template for the post, after post loop, after author box
<div class="fb-comments" data-href="http://mydomain.zzz" data-width="100%" data-numposts="5"></div>
Only trick is when you do the form, then get code, it will say “item not public, make public on your app menu” then trick there is to put in email, namespace (sitename all lower case), domain for app. Then click to make public. Going back to the configurator doesn’t make a new app, you’re still making just the ONE app for your site you specify; you can’t make 2 accidentally!
I think Q 4 answer is because “theme is setup that way.” Doing a query by both would add a lot of overhead for every page load to search TWO different tables. At least that was what I understood.
You could likely hack the function file for that to modify the loop to query BOTH tables in the dbase.
Also, most posts are in a “category” with “tags” being additional fodder, such as
cat = books
tag = nonfiction
since all nonfiction items would also be in books, a bit redundant for most folks.
I would likely presume category to be a macro search and tag to be a micro search.
Just some thoughts on that you didn’t ask for 😉
-
This reply was modified 10 years by
simchris.
Hi
To avoid posts from Press Releases category being displayed on front page you need to edit it and ad its ID in post loop settings > multiple category filters: http://screencast.com/t/3hivCJYoRh8g
If this is not what you mean please provide more details.
Thanks!
Hi
we are pondering using the FB comments plugin generated from FB dev site (not WP comments ‘plugin’).
Trick is
a) putting the required div and javascript after body, ONLY on post template — not the header file … we use template 2 as default for posts
b) have to insert the function call for FB comments below the post — tricky with the single post file, single template file, and single loop file, for correct spot ( I tried and got server error, so obviously … duh …)
c) need to remove the “number of comments” element in the single post template, since it cannot count from the FB comments
d) in our version of theme we still get the “NO COMMENTS Comments are closed.” element at bottom of posts, so need to hide that, obviously.
Anybody who has done this with Newsmag would love some feedback on both how to hack this and also any performance issues (aware of the cookies and junk sent by FB, but with local comments on, we get no comments; with Disqus on we get comments, but some folks hate that — so, FB comments getting more and more common, so thought we’d try it …)
Thanks all! 🙂
Guys, tried adding the code to single.php and to single loop.php to no avail.
Where exactly should I put the ad code/tag to display just above Related Articles?? This seems simple in principle, but not showing properly.
I even tried with the custom_ad shortcode. nothing shows.
Any tips appreciated. thanks
Hi
The code that you provided affect only the posts displayed by the loop on category page: http://screencast.com/t/sifOdJro The posts from sidebar are displayed by a different query, depending by the widget used. If you use one of the theme’s blocks then the query is made in td_data_source.php and you can use theirs filters to sort your posts: http://screencast.com/t/gbllh8R6iu If the widget it’s from WordPress then the query is made in WordPress core.
Thanks!
Hi peeps,
Have been trying to search high and low for a solution but to no avail. I’m encountering an unusual bug on one of the category page where the pagination would just load the same set of posts again and again. Any pointer on where it could have gone wrong? The page in question is here: http://hamiig.com/category/artist-directory/
Cheers,
Sandy
Dear author, I have purchased and implemented your theme on the following domain. entertainmentpunjab.com
I need immediate help for the following issue. I want to create an infinite scroll of posts where the footer of my single post ends example is the post below.
http://www.entertainmentpunjab.com/2016/02/happy-raikoti-desi-crew-crazy-demands-song-out-now/
at the bottom of this post you will find related articles section and more from author below this section I want to call all posts the once that are running in home page below load more button. Kindly assist me in doing so by letting me know where i have to make changes in code in loop-single.php file and what is the code.
Thanks & Regards,
Vishal
Hi
The theme have support for custom post types and custom taxonomies, for more details about this please check our documentation: https://forum.tagdiv.com/custom-post-type-support/
We don’t have a template hierarchy documentation but the theme it’s coded according with WordPress standards and the hierarchy is the same. More details about this can be found here: https://developer.wordpress.org/themes/basics/template-hierarchy/ Because the theme it’s very complex the file structure it’s a bit different then in a default wp theme. For example the theme have more loop/single files because have more posts templates. Best way to check each file role is to create a test install on your computer, then start editing and see how the your changes affect the front end.
Thanks!
Hello,
In order to make this modification you will have to edit the theme files corresponding to the post templates you use on your posts. Every post template has 2 files for it: http://screencast.com/t/gq6JpObz23Z you will have to copy the comments code from the single_ files to the loops files and place it under the related articles like so:
http://screencast.com/t/6hmQSWFSD and http://screencast.com/t/Dhxa3UYF8
I hope this helps.
Thank you!
Hello,
As i understand it, you want to move the related articles in the sidebar. You can do it like so:
Copy this part of the code from the loop files: http://screencast.com/t/W4EqWWOw6YJ8 and place it below the sidebar in the single files: http://screencast.com/t/WdJkyKUlJr
You can do this for every template you use on your posts. Every file number coresponds to the template you select on your post edit.
If yopu want to have the more from author first, you can switch their position here: http://screencast.com/t/Itd4Ql6HKxJ
I hope this helps.
Thank you!
Hi,
Seems like pagination resets the loop set within modules and blocks
How can I prevent this reset? I’d like to keep track of which number post the user is seeing, and display different ads as he gets further down the list of posts. However, the load more seems to prevent that, and sets the counter back to zero
Please advise
Thanks in advance!
Hi
If you’re using the blog template the number of posts displayed on page can be set from Settings > Readings: http://screencast.com/t/PezvcLRjYJ For the pagebuilder + latest article template the post number can be set from post loop settings: http://screencast.com/t/feMG6RbW6t
Thanks!
I’m testing the theme here: http://roberttew.com
I’d like to loop the ads on the home page (see http://www.livelifehappy.com) and on all the other numbered pages under the 1st and 3rd post. How can I do this?
For my current theme – I’ve added this code to the index file:
index.php file under <?php /* Start the Loop */ ?>
line added: <?php $adcounter = 0; ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if ($adcounter == 1) : ?>
<div style=”text-align: center;”>
<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<!– 300×250 Home Page Below 1st Post –>
<ins class=”adsbygoogle”
style=”display:inline-block;width:300px;height:250px”
data-ad-client=”ca-pub-xxxxxxxx”
data-ad-slot=”8474826612″></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>
Question 1: How do I put an Adsense ad below the first post and third post on the home page? For my current theme (please visit http://www.livelifehappy.com) I just added the following line in the index.php file under <?php /* Start the Loop */ ?>
line added: <?php $adcounter = 0; ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if ($adcounter == 1) : ?>
<div style=”text-align: center;”>
<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<!– 300×250 Home Page Below 1st Post –>
<ins class=”adsbygoogle”
style=”display:inline-block;width:300px;height:250px”
data-ad-client=”ca-pub-xxxxxxxx”
data-ad-slot=”8474826612″></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>
<br>
Question 2: How do I add ads below the title of single post/pages and below content? I tried using the ad box in the theme options but it seems to stretch my 300×250 ads to fit the post box. I’d like it to stay the same. Please visit http://livelifehappy.com/life-quotes/closure-is-such-a-beautiful-thing-not-because-it-helps/ and http://livelifehappy.com/17-rules-for-happiness-being-happy/
***I just need to loop the Adsense ads (under 1st and 3rd post) on the home page and throw an ad that doesn’t resize under the title of post/pages and under the content/social share buttons. I will switch over once I figure out how to do those things.
Thanks
Hello,
Every post template has 2 files to it. The default template uses single and loop single and the numbered ones correspond to the post template number you use. Only one of the 2 files needs to be edited for each post template but that depends on the modification you want to make. If it’s a simple message it will work from the single.php files so you will only need to edit these files corresponding to the templates you use on your posts: http://screencast.com/t/GerHlepd8EnM
As a test you can add some text inside one of these files and locate a post that has the specific template like so: http://screencast.com/t/5qom8tVw8ey1
Result on frontend: http://screencast.com/t/etm3PkNerV
I hope this helps.
Thank you!
Hi all, if I set my homepage to a static page, I get a redirect loop error in every browser. When I put the homepage as “view latest posts” then everything is fine. This happens on every page I create. I have disabled all the plugins except those needed for Newspaper 6 and it still occurs. I have activated 2011 theme and it still occurs.
Hi
You can place the ad in regular posts by editing the files corresponding with the post template used for that post: http://screencast.com/t/DPhrOvKEKF For post template 1 the files that must be edited are loop-single-1.php or single_template_1.php, depends where you want to place the ad.
Thanks!
when I checked my wordpress https website today i found some redirecting errors.
I never created those redirection on my side.
https://www.estambul.net/sitios-de-interes/mezquita-azul/
https://www.estambul.net/sitios-de-interes/santa-sofia/
these two posts redirected to
https://www.estambul.net/sitios-de-interes/museo-arqueologico-de-estambul/
and this
https://www.estambul.net/sitios-de-interes/museo-arqueologico-de-estambul/
redirected to
https://www.estambul.net/sitios-de-interes/santa-sofia/
all these creates an infinite loop.
My htacess is like this
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
<IfModule mod_headers.c>
Header always set Strict-Transport-Security 'max-age=31536000' env=HTTPS
</IfModule>
# END rlrssslReallySimpleSSL
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Please help. How i iwll solve this problem.
Which file creating this.
I have checked posts, htacess even mysql. butr i couldnt fine anything please help.
# END WordPress