Excellent!
If I copy that path and file to my child theme will it work?
That’s the file I needed! I was able to set custom widths to use 100% of the available column by entering the maximum pixels for each screen width (large, tablet, phone).
Note for dev’s on the next release:
It would be great to have an option to set the WIDTH to 100% and then set the HEIGHT to a pixel size. This allows Adsense to fill in the enitire space with their own “responsive” content (see screenshot example here: https://drive.google.com/file/d/0B6gU7u_IRLlzTHUteGxUNFkzUEU/view).
The full width ads perform MUCH better than the defined ad spots. In my case, the earnings are more than 4X times higher. I can’t post actual numbers here but I will be happy to share results with you if you’d like to contact me directly.
Thanks!
-
This reply was modified 10 years by
five40.
Hi Bogdan-
Actually, I have not found that to be the case. I am seeing a big difference between the Newspaper formatted ads and raw Adsense code.
Here is an example test that I put together:
http://wisemindhealthybody.com/ad1/ad-test/
Here is a screenshot that shows the difference:
https://drive.google.com/file/d/0B6gU7u_IRLlzTHUteGxUNFkzUEU/view
From what I can tell, the main difference is the “width” attribute. The Newspaper generated ad is limited to 300px width while the raw Adsense ad has no width attribute.
The result is that the raw Adsense ad uses the entire width of the column (see screenshot above) and this produces MUCH higher revenue. I have a different site (non-Newspaper) in the same category with very similar articles and the larger ads consistently generate 2-3 times more revenue.
Any feedback on how to remove the width constraint will be greatly appreciated!
Thanks!
We’re doing over 10 million pageviews a month and Newspaper is running like a champ.
Our setup: 1 VPS webserver (12 core/16 GB ram), 1 VPS Db server (4 core/4 GB ram), 1 VPS Varnish server (2 core/2 GB ram).
Sorry- posted in wrong forum. This is for Newspaper.
I am finally getting around to making my customizations.
The example you provided is very helpful and I think I am close.
However, I am attempting to add this to a plugin and it’s not working.
The purpose of my plugin is to add the content of one specific post to the end of all the posts on the site. I’d like to modify this so I can add choose one post to add to smartlist articles and another post to add to articles that are not smartlists.
This is my existing code that works on all articles:
function wmhb_filter_content1($content) {
if(is_single()) {
$my_postid = 15304; // Enter ID of page to append
$post_object = get_post( $my_postid );
$new_content1 = $post_object->post_content;
$content .= $new_content1;
}
return $content;
}
add_filter('the_content', 'wmhb_filter_content1');
This is my attempt at incorporating your example. This does not work- no content is returned.
function wmhb_filter_content1($content) {
$td_smart_list = get_post_meta($this->post->ID, 'td_post_theme_settings', true);
if (!empty($td_smart_list['smart_list_template'])) {
$my_postid = 15304; // Enter ID of page to append
$post_object = get_post( $my_postid );
$new_content1 = $post_object->post_content;
$content .= $new_content1;
}
return $content;
}
add_filter('the_content', 'wmhb_filter_content1');
I realize this is out of scope for the support you provide but if you can assist me in getting this to work I’ll be very grateful!
-
This reply was modified 10 years by
five40.
Hi Catalin-
I am already using is-single(). I’d like to specifically reference ONLY posts that use the SmartList format.
This is pseudo code…
is-single(format="smartlist")
I know that won’t work but if you could point me in the right direction I’d be grateful.
Hey Chris-
Yeah, we got an early invite from FB so just playing with the plugins now.
Hi Gunnar-
Here is the code I came up with:
/* ----------------------------------------------------------------------------
Filter for adding additional pages to a smart list article v1.02
----------------------------------------------------------------------------- */
// We want to show an existing article as a promotion when a user clicks Next while viewing a smart list article
// NOTES FOR ARTICLES USED AS ADS/PROMOTIONS AT END OF SMART LIST:
// 1. Make the promo article a Smart List
// 2. The first line of the article used as a promotion must start with a <h3> header
function add_promo_to_smartlist($content) {
if(is_single()) {
$my_postid = 15304; // Enter ID of post to append
$post_object = get_post( $my_postid );
$new_content1 = $post_object->post_content;
$content .= $new_content1;
}
return $content;
}
add_filter('the_content', 'add_promo_to_smartlist');
NOTE: I have only used this with Smart List 7.
I made this into a plugin but you can also use it in your functions.php file. (Use at your own risk! I know just enough about this stuff to be dangerous.)
Thanks Bogdan- That will come in useful!
Thanks Bogdan.
I took a look at that file, and yes, way beyond my skills.
I realize that I’m pushing the smart list outside of it’s intended scope but I did find a workaround for those that might want to do the same. It seems that the smart list functionality uses the CSS class wp-image-xxxx (replace xxxx with the image ID) to identify and reposition the images in the smart list layout. That class is added when you insert an image with the Add Media button in the editor.
To override the core smart list functionality you simply need to remove that class. One option is to manually remove it by going through the code in Text mode.
Another option is to apply a filter to always remove/change that class when using the Add Media button. To do that, add the following to your functions.php file:
/* Strip out wp-image css class when using Add Media button */
function filter_image_send_to_editor($html, $id, $caption, $title, $align, $url, $size, $alt) {
$html = str_replace('wp-image-', 'id-image-', $html);
return $html;
}
add_filter('image_send_to_editor', 'filter_image_send_to_editor', 10, 8);
Instead of removing the class completely, we chose to change the it from wp-image-xxxx to id-image-xxxx just in case we need to use for another purpose in the future.
-
This reply was modified 10 years by
five40.
Okay, that makes more sense now. I’d like to modify Smart List 7 to have the image above the text when I use the Add Media button. Can you point out which files control that behavior?
I played around with the PHP but settled on a JS solution.
If anyone else needs to make this work here is what we used:
jQuery('a.td-smart-list-button').each(function () {
var href = jQuery(this).attr('href');
if (href !== undefined) {
var urlparam = location.search;
href = href + urlparam;
jQuery(this).attr('href', href);
}
});
Hi Emil-
This is wonderful, thanks for the detailed reply.
I’m not using a plugin to generate the the query string. This is for tracking affiliate codes, Google analytics UTM codes, and similar items that are added at the time the article is shared via social media, email, etc.
I’d like to configure the site to pass “any” query string to all of the pages within the smart lists. In other words, if a visitor hits a smart list with http://site.com/smart-list/?var1=abc&var2=def&var3=ghi , I’d like that whole string to be appended to each additional page of the smartlist.
I think using $_SERVER[‘QUERY_STRING’] would do the trick but I’m not confident in my PHP skills and don’t have a test site to play with.
Can you assist?
Thanks!
In my experience (working with very high traffic sites) you’re pretty much wasting time with the footer. If your list is a priority I’d go with a form in a sticky sidebar.
For maximum engagement, use a pop-up. You will piss a few people off but the increase in people that do sign up is worth it in my opinion. Just make sure you use a cookie so you don’t keep hitting the same people over and over.
This really helped, thanks.
FYI, the default setting throws an error on FB’s Debugger. They require the full path to the image and the code above only provides a relative path.
I would recommend going through the documentation very slowly and carefully and try switching every option on/off and watch to see what happens with each change. Take your time and make sure you thoroughly understand each feature before moving on to the next one.
This theme is packed with goodies and yes, it can be overwhelming. Again, take your time but don’t be afraid to jump in and play. That’s how you’ll learn.
Have fun!
