- NewspaperWP Rocket and Newspaper Theme: Optimization Guide
- TutorialsFrom WPBakery to tagDiv Composer
- TutorialsDefault Block Settings Guide
- TutorialsHow to use custom fonts
Hello,
I tried newspaper 6 on my test site with old version and i followed this https://forum.tagdiv.com/how-to-update-the-theme-2/ but no good test site link: http://723.8f9.myftpupload.com/. I did many customization in CSS. Is there any way that i can keep both? So i start working with new theme and fit as per my need then i can switch? like rename the folder name of theme? it would work?
Thanks.
Yes, I cleared cache after both css snippets. Very strange, but good that it worked for you, hhealth.
Hi,
1. Please disable all your plugins leave just Visual Composer active and clear cache. You can change the block title from settings – http://screencast.com/t/J7dTw8ny0Cdv
2. You have an option for each block to filter by category – http://screencast.com/t/djlQMLoY7D
3. For tagdiv blocks you can change the title color and background – http://screencast.com/t/wNXFYuwJHqTy please provide more details what title color you want to change as wordpress widgets titles can be changed using custom css.
4. Please provide more details as I’m not sure what you mean, also a screenshot and your site url may help.
Thanks!
Have you tried clearing Cache afterwards? I used the first CSS and it worked on my site
Hi,
1. Please try this custom css in Theme Panel > Custom Css it will be applied on all big grids:
.td-hover-1 .td-big-grid-post:hover .td-module-thumb .entry-thumb {
transform: none;
-webkit-transform: none;
-moz-transform: none;
}
If you want this only for home please add the .home class.
2. Unfortunately there is no general option and you have to set it manually each one.
3. You can try this custom css: http://screencast.com/t/wJUvDaaPaAJB
.td_block_big_grid_2 .td-big-grid-post-0 .td-meta-info-container {
display: none;
}
4. The theme doesn’t have an option to show post views on modules anymore. You will have to copy the vies function from td_module_single_base.php to td_module.php – http://screencast.com/t/izGddMRU and call the views on each module: http://screencast.com/t/YFATXWXCZt you may need additional css customizations. For example – http://screencast.com/t/sbnmcCbKpB0l
<?php echo $this->get_views();?>
5. Unfortunately you need to inspect and change the background and color for each one – http://screencast.com/t/6Q0FKEhJE
.td-module-comments a{
background-color: #cbcbcb !important;
}
.td-module-meta-info .td-post-views{
color: #cbcbcb;
}
.td-module-comments a:after {
display: none;
}
6. Theme doesn’t have an option to disable more from author, but you can hide it using custom css – http://screencast.com/t/OPfLLMowFK3M
.td_block_related_posts .td-related-right {
display: none;
}
7. Provide a link so we can take a look
8. The widget/block title background can be added from block settings and that color will be when your hover on article title from that block – http://screencast.com/t/rX1wEZVy
Thanks!
-
This reply was modified 11 years by
Alin [tagDiv].
the slider gets messed up by the speedbooster plugin, sooo…here is the code 😉 as I don’t know what I did other than the performance improvement tips ( Is this required? As the performance drops from 93 to 91 after activating it).
<?php
/*
Plugin Name: tagDiv Speed Booster
Plugin URI: http://tagdiv.com
Description: Speed booster for Newspaper and Newsmag theme - It moves the styles and all the scripts of the theme to the bottom when needed. It activates internal theme optimizations for better speed and it adds async js .
Author: tagDiv
Version: 3.2
Author URI: http://tagdiv.com
*/
/*
3.2 - better bbpress support on newsmag
3.1 - fixed issue with flashing white on load on newspaper theme
- better compatibility with themes that do not have wp booster framework
- Newsmag loads fonts in a bundle now
3.0 - better visual composer support
2.8 - Newsmag support added :)
2.7 - fixed ie 9 10 11 window resize bug
2.6 - fixed rendering bug on the loading of the page
2.5 - code improvements, newspaper 4 compatibility
- makes most of the javascript files use defer parsing
- better compatibility with revolution slider
2.4 - updated jquery version
- support for https
2.3 - fixed warnings when trying to move javascript files that are not registered
*/
define('TD_SPEED_BOOSTER' , 'v3.2');
class td_speed_booster {
var $styles_for_footer = array(); // here we keep all the stylesheets IDs that we want to move to the footer
var $is_ie = false; // if the browser is detected as IE, treat it differently
var $async_js_scripts = array(
'contact-form-7',
'bbpress',
'woocommerce',
'site',
'devicepx',
'js_composer_front'
);
var $td_theme_name = '';
var $td_theme_version = '';
var $td_deploy_mode = '';
function __construct() {
add_action('td_wp_booster_loaded', array($this, 'td_wp_booster_loaded'));
}
function td_wp_booster_loaded() {
// read the theme version and name if defined
if (defined('TD_THEME_VERSION') and defined('TD_THEME_NAME') and defined('TD_DEPLOY_MODE')) {
$this->td_theme_version = TD_THEME_VERSION;
$this->td_theme_name = TD_THEME_NAME;
$this->td_deploy_mode = TD_DEPLOY_MODE;
} else {
return;
}
// detect IE 8 9 10 11
if (!empty($_SERVER['HTTP_USER_AGENT']) and (preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']) || (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false))) {
$this->is_ie = true;
}
// add hooks
add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_hook'), 1002); // 1002 priority - because visual composer has 1000 and we use 1001 in the wp010 theme
add_action('wp_footer', array($this, 'wp_footer_hook'), 15);
if ($this->is_ie === false) {
add_action('wp_head', array($this, 'wp_head_hook'), 15);
}
}
function enqueue_scripts_hook() {
global $wp_scripts;
//detect revmin - revolution slider and do not move jquery
if( !is_admin() and !isset($wp_scripts->registered['revmin'])){
if (is_ssl()) {
$td_protocol = 'https';
} else {
$td_protocol = 'http';
}
wp_deregister_script('jquery');
wp_register_script('jquery', ($td_protocol . '://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'), true, '1.11.1', true);
wp_enqueue_script('jquery');
}
if ($this->td_theme_name == 'Newsmag') {
/* wp 010*/
$this->move_style_to_footer('js_composer_front');
$this->move_style_to_footer('js_composer_custom_css');
}
// Newsmag dosn't move the css to the bottom as such, bbpress should stay at the top
if ($this->td_theme_name != 'Newsmag') {
$this->move_style_to_footer('bbp-default-bbpress'); //bpress old
$this->move_style_to_footer('bbp-default'); //bpress
$this->move_style_to_footer('google-font-rest');
$this->move_style_to_footer('contact-form-7');
$this->move_style_to_footer('genericons');
$this->move_style_to_footer('jetpack');
$this->move_style_to_footer('jetpack-widgets');
$this->move_style_to_footer('jetpack-subscriptions');
$this->move_style_to_footer('sharing-css');
}
/**
* Move the style only on newspaper
* @todo move the style also on newsmag after we fix all the issues
*/
if ($this->is_ie === false and $this->td_theme_name == 'Newspaper') {
$this->move_style_to_footer('td-bootstrap');
$this->move_style_to_footer('td-theme'); //this is the main style of the theme, it depends on td-bootstrap to load
}
$this->move_style_to_footer('woocommerce_frontend_styles');
//jetpack lost styles
$this->move_style_to_footer('jetpack-subscriptions');
$this->move_style_to_footer('jetpack-widgets');
$this->move_style_to_footer('genericons');
$this->move_style_to_footer('jetpack');
$this->move_style_to_footer('td-theme');
$this->move_style_to_footer('sharing-css');
/**
* move javascript to footer
*/
$this->move_js_to_footer('themepunchtools');
$this->move_js_to_footer('revmin');
// remove strange custom.css file loaded by visual composer
wp_deregister_style('js_composer_custom_css');
// replace comment-reply.min.js with inline version
}
function wp_footer_hook() {
//get the theme version for style
$current_theme_version = $this->td_theme_version;
//on demo mode, autogenerate version hourly + day
if ($this->td_deploy_mode == 'demo') {
$current_theme_version = date('jG');
}
foreach ($this->styles_for_footer as $style_id => $style_src) {
echo "<link rel='stylesheet' id='" . $style_id . "-css' href='" . $style_src . "?ver=" . $current_theme_version . "' type='text/css' media='all' />\n";
}
}
function wp_head_hook() {
if ($this->td_theme_name == 'Newspaper') {
echo '<style>body {visibility:hidden;}</style>';
}
}
function move_style_to_footer($style_id) {
global $wp_styles;
if (!empty($wp_styles->registered[$style_id]) and !empty($wp_styles->registered[$style_id]->src)) {
$this->styles_for_footer[$style_id] = $wp_styles->registered[$style_id]->src;
wp_deregister_style($style_id);
}
}
function move_js_to_footer($js_id) {
global $wp_scripts;
if (isset($wp_scripts->registered[$js_id])) {
wp_enqueue_script($js_id, ($wp_scripts->registered[$js_id]->src), '', $wp_scripts->registered[$js_id]->ver, true);
}
}
function async_js_hook($url) {
//check to see if we have js
if (strpos( $url, '.js' ) === false) {
return $url;
}
if ($this->strpos_array($url, $this->async_js_scripts) === false) {
return $url;
} else {
return "$url' defer='defer";
}
}
private function strpos_array($haystack_string, $needle_array, $offset=0) {
foreach($needle_array as $query) {
if(strpos($haystack_string, $query, $offset) !== false) {
return true; // stop on first true result
}
}
return false;
}
}
new td_speed_booster();
-
This reply was modified 11 years by
cem.
OK. I’ve never modified modules, where do I go to do that? Also, where should the custom CSS go and should I be using a daughter theme if I’m making changes like this? Thanks!
Hi Alin,
thanks for your help. For some reason that didn’t work for my site, see http://www.brettspiele-magazin.de/spinderella/
I do leave your code included in the custom css box in theme panel so that you can better check what is happening.
regards,
julingn
thx Alin
unfortunately I’m not able to resolve the issue. At this moment all plugins are deactivated except composer and I get
Fatal error: Call to undefined function get_base_recaptcha_lang_code
I think I played too much with fucntion.php would be cool if someone would take a look and I think the prob for the jquery messages may lay here too.
EDIT: ok I commented the lang part out and now it works, somehow it was anyway double. The slider is also visible now though the thumbs and image are scaled too large, how can fix that one ?
On the jquery error before I assume I activate plugins one by one and see where the pain comes right ? and off I go..
<?php
/* ----------------------------------------------------------------------------
WordPress booster framework - this is our theme framework - all the content and settings are there
It is not necessary to include it in the child theme only if you want to use the API
*/
if (!defined('TD_THEME_WP_BOOSTER')) {
include TEMPLATEPATH . '/includes/td_config.php';
include TEMPLATEPATH . '/includes/wp_booster/td_wp_booster_functions.php';
}
/*include theme.js under newsmag to put modal image on*/
/* include theme.js*/
/*wp_enqueue_script( 'theme-js', get_stylesheet_directory_uri() . '/js/theme.js', array( 'jquery'), NULL, TRUE );*/
remove_action( 'wp_head', 'wp_generator' ) ;
remove_action( 'wp_head', 'wlwmanifest_link' ) ;
remove_action( 'wp_head', 'rsd_link' ) ;
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'feed_links_extra', 3 );
add_filter( 'pre_comment_content', 'wp_specialchars' );
function no_errors_please(){
return 'You appear to be up to no good. Please stop now!';
}
add_filter( 'login_errors', 'no_errors_please' );
// and we hook our function via
add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );
function delete_enclosure(){
return '';
}
add_filter( 'get_enclosed', 'delete_enclosure' );
add_filter( 'rss_enclosure', 'delete_enclosure' );
add_filter( 'atom_enclosure', 'delete_enclosure' );
// function remove_cssjs_ver( $src ) {
// if( strpos( $src, '?ver=' ) )
// $src = remove_query_arg( 'ver', $src );
// return $src;
// }
// add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
// add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'jpeg_quality', create_function( '', 'return 65;' ) );
//remove render blocking by jetpack
add_filter( 'jetpack_implode_frontend_css', '__return_false' );
function remove_pingback_url( $output, $show ) {
if ( $show == 'pingback_url' ) $output = '';
return $output;
}
add_filter( 'bloginfo_url', 'remove_pingback_url', 10, 2 );
// add_action('init', 'myoverride', 100);
function myoverride() {
remove_action('wp_head', array(visual_composer(), 'addMetaData'));
}
function dequeue_visual_composer_css() {
if (is_single()) {
wp_dequeue_style('js_composer_front');
}
}
// Defer jQuery Parsing using the HTML5 defer property
if (!(is_admin() )) {
function defer_parsing_of_js ( $url ) {
if ( FALSE === strpos( $url, '.js' ) ) return $url;
if ( strpos( $url, 'jquery.js' ) ) return $url;
// return "$url' defer ";
return "$url' defer onload='";
}
add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
}
// Remove WP version number from js and css files.
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
function tweakjp_add_sharing_js() {
wp_enqueue_script( 'sharing-js', WP_SHARING_PLUGIN_URL . 'sharing.js', array( ), 4 );
$sharing_js_options = array(
'lang' => get_base_recaptcha_lang_code(),
'counts' => apply_filters( 'jetpack_sharing_counts', true )
);
wp_localize_script( 'sharing-js', 'sharing_js_options', $sharing_js_options );
}
add_action( 'wp_enqueue_scripts', 'tweakjp_add_sharing_js' );
function tweakjp_add_sharing_css() {
wp_enqueue_style( 'sharing', WP_SHARING_PLUGIN_URL. 'sharing.css', false, JETPACK__VERSION );
}
add_action( 'wp_enqueue_scripts', 'tweakjp_add_sharing_css' );
-
This reply was modified 11 years by
cem.
Hi,
Please try this custom css in Theme Panel > Custom Css: http://screencast.com/t/feXVaxbOzj
.td-related-title > .td-related-right {
display: none;
}
Thanks!
Hi,
You can try this custom css in Theme Panel > Custom Css and see if it helps – http://screencast.com/t/qmqHid1ifw5
.td-header-menu-wrap-full {
height: 30px !important;
}
.td-header-gradient:before {
bottom: -10px;
}
.td-header-menu-wrap, .td-header-main-menu {
max-height: 30px;
}
#td-header-menu {
min-height: 30px;
}
.sf-menu > li > a {
line-height: 30px;
}
Thanks!
Thanks for getting back to me…
I’m not able to close the gaps with the CSS you gave me: http://take.ms/T7Xe9, http://take.ms/XgVIC
Link to my site to take a look at the logo: http://news.snowwatch.org.uk/
Hi,
Thanks, this is what I wanted.
But, if I will switch to theme 6 which settings will be changed? Which things will be affected like pages, posts, custom css etc. ?
And how to replace existing theme with new theme? I have downloaded the new theme.
Thanks,
CareOnGO
Hi ALin,
Thanks, we used the standard widget from wordpress, can we remove with this css tweak all the sidebars from mobile devices.
We will try it.
Thanks
Bună ziua,
În primul rând, felicitări pentru noua versiune grozavă a temei Newspaper! Am instalat-o de îndată ce a apărut și am configurat-o pe site-ul meu și arată super!
Cu toate acestea, am unele întrebări. Nu știu dacă sunt erori sau dacă nu am făcut eu ceva bine, așa că le voi înșira mai jos, poate mă puteți ajuta:
- Cum fac ca reclama „Article top” să fie centrată în pagină? În afară de Google Chrome, unde apare corect, în Safari, spre exemplu, apare mult prea în dreapta și este afișată chiar și sub sidebar (atât pe desktop, cât și pe iPad).
- Cum pot accesa din nou Forumul bbPress? După actualizare nu se mai deschide forumul: https://itutorial.ro/forum/
- Pot să șterg din fișierele temei tot ce este din aprilie și să las numai ce este adăugat în iunie? Am actualizat prin metoda standard tema, fără să văd că recomandați ștergerea versiunii vechi și instalarea celei noi, așa că mi-au rămas unele fișiere vechi. Am văzut că page-homepage-bg.php, page-homepage-bg-loop.php, page-homepage-blank.php, page-homepage-loop.php, page-homepage-timeline.php trebuiesc șterse și le-am șters, însă au mai rămas câteva fișiere vechi, cum ar fi Loop-timeline.php, vc_templates, less_files, rtl.css și altele, din aprilie. Pot să le șterg și pe acelea – mai este nevoie de ele?
- De ce unele resurse javascript, cum ar fi eticheta de la trafic.ro sau Descarcă de pe Magazin Play apar mari în footer – înainte de actualizare nu apăreau supradimensionate?
Cam atât deocamdată. Dacă mai întâlnesc ceva, actualizez postarea asta sau las una nouă :D.
Mersi!
Hi,
1. Please provide a link as I need to check this on your site.
2. I have added this on our list and it will be fixed in future update, thanks for reporting this.
Please try this custom css in Theme Panel till then – http://screencast.com/t/ye67hUkd8E2w
.td-post-template-4 .td-post-header-holder {
margin-top: 0;
}
3. Please try this custom css:
.td-post-source-tags {
margin-bottom: 10px;
}
.td-post-content {
padding-bottom: 5px;
}
Thanks!
Hi,
Not sure what you mean please provide more details and also a link. If you want to rewrite the inline css you can use the !important tag.
Thanks!
Hi there,
You don’t need custom CSS. Go to Theme Panel > Post Settings > Post Settings and disable Show Post Views.
Add this using Custom CSS:
@media (max-width: 767px) {
.td-header-wrap .td-header-menu-wrap-full,
.td-header-wrap .td-header-menu-wrap,
.td-header-wrap .td-header-main-menu {
background-color: #ffffff !important;
}
Hi,
This is the default css for comments and views, you can try to adjust the top value to appear besides post title. I’m not sure if it will look fine all posts as the title length differs and also the theme has mor post style so it will be hard to make that custom css looks fine on all, but you ca try.
Thanks!
Hi,
You can add an image/icon as a label for your menu item like this: http://screencast.com/t/QB2oA2mk then you have to use some additional css to set an height for you new menu item, for this you can use the unique class that each menu item has to target just the menu item you’ve created and set an height to it, like this: http://screencast.com/t/q3H6cvts
Please make sure that you have added the url properly as I have also checked this and it it works fine using social icons block – http://screencast.com/t/tLdijB1yZgm5
Thanks!
-
This reply was modified 11 years by
Alin [tagDiv].
Hi,
1. Please check documentation – https://forum.tagdiv.com/how-category-settings-work/
2. If you don’t want comments section to appear on your article you can disable it from Post Settings – http://screencast.com/t/Er7yeRup
3. Try this css code in Custom Css section – http://screencast.com/t/ogherlmk
.td-post-content {
padding-bottom: 0px;
}
4. Please check Excerpt section – https://forum.tagdiv.com/excerpts-introduction/
5. Please check Theme Fonts – https://forum.tagdiv.com/font-customization/
6. It is not an issue when you hover on article title it takes the color that you he set for background to the block title. What do you mean “I can’t see anything “.
7. Theme doesn’t have an option to change the post title color for each block, you have to use custom css: http://screencast.com/t/V2sNqzET
.home .td_block_11 .entry-title a {
color:red;
}
8. Try this custom css in Theme Panel > Custom Css: http://screencast.com/t/zq0XpKBRxkb
.home .td_block_11 .td_ajax_load_more {
background-color: red;
color: black;
}
9. No, there is not an option only for homepage. You can use custom css if you want this only on homepage: http://screencast.com/t/d5t8BjLn If you want this for all homepage blocks just remove .td_block_11 – http://screencast.com/t/oz2M6fBuZqW
.home .td_block_11 .block-title span {
font-size: 10px;
}
10. Check this custom css: http://screencast.com/t/feXVaxbOzj
.td-related-title > .td-related-right {
display: none;
}
Please post your issues in Newspaper section!
Thanks!
Hello,
I don’t success to downsize the Height of the main menu it’s actually 48 px and i want 30
But when i try in the css, all shifts
Can someone help me pls
Hi 😀
It´s some way to hide views count on newspaper 6?
I try whit custom CSS
.entry-comments-views span{
display: none;
}
.entry-comments-views span.td-sp-ico-view{
display: none !important;
}
.td-icon-views{
display: none;
}
Whit not luke
At the bottom of the page there is a more than 200 lines of inline css. How can I get rid of it?