Search Results for 'child theme how to functions.php'

Results from the Forum
Calin
tagDiv Staff

Hi,

Please make sure that you do not have a plugin conflict, please deactivate ALL plugins except tagDiv Composer, also if you are using child theme or cache plugin, deactivate them, clear all cache and try again.

If the problem persist, please set this code in functions.php -> wp-content/plugins/td-composer/legacy/Newspaper/functions.php
add_action('admin_head',function() {
echo '<style>.td-gutenberg-editor .editor-styles-wrapper .wp-block {max-width:726px;}</style>';
});

Or you can send us an email at contact@tagdiv.com and provide admin login, as well as cPanel or FTP if possible. We will take a look. Include a link to this topic in the email.

Thank you!

Calin
tagDiv Staff

Hi,

Please do not replay in your topic, this will only delay the time until you get the answer, we answer in topics from oldest to newest.
Please make sure that you do not have a plugin conflict, please deactivate ALL plugins except tagDiv Composer, also if you are using child theme or cache plugin, deactivate them, clear all cache and try again.

If the problem persist, please set this code in functions.php -> wp-content/plugins/td-composer/legacy/Newspaper/functions.php
add_action('admin_head',function() {
echo '<style>.td-gutenberg-editor .editor-styles-wrapper .wp-block {max-width:726px;}</style>';
});

Or you can send us an email at contact@tagdiv.com and provide admin login, as well as cPanel or FTP if possible. We will take a look. Include a link to this topic in the email.

Thank you!

Vlad S
tagDiv Staff

Hi,

Please make sure that you do not have a plugin conflict, please deactivate ALL plugins except tagDiv Composer, also if you are using child theme or cache plugin, deactivate them, clear all cache and try again.

If the problem persist, please set this code in functions.php -> wp-content/plugins/td-composer/legacy/Newspaper/functions.php
add_action(‘admin_head’,function() {
echo ‘<style>.td-gutenberg-editor .editor-styles-wrapper .wp-block {max-width:726px;}</style>’;
});

Or you can send us an email at contact@tagdiv.com and provide admin login, as well as cPanel or FTP if possible. We will take a look. Include a link to this topic in the email.

Thank you!

Vlad S
tagDiv Staff

Hi,

Please make sure that you do not have a plugin conflict, please deactivate ALL plugins except tagDiv Composer, also if you are using child theme or cache plugin, deactivate them, clear all cache and try again.

If the problem persist, please set this code in functions.php -> wp-content/plugins/td-composer/legacy/Newspaper/functions.php
add_action(‘admin_head’,function() {
echo ‘<style>.td-gutenberg-editor .editor-styles-wrapper .wp-block {max-width:726px;}</style>’;
});

Or you can send us an email at contact@tagdiv.com and provide admin login, as well as cPanel or FTP if possible. We will take a look. Include a link to this topic in the email.

Thank you!

sentierol
Participant
#0

Dear Calin/staff,
in the last week you upgraded our Newspaper from 9.6 to the 10.3.2 due to graphic problems we encountered in upgrading even following your tutorials.

I noticed that the child theme once active, now is deactivated. It’s a Newspaper 9 Child theme.

Now, given that I’d like to edit the functions.php file, is it safe to reactivate that Child Theme (I’d prefer this option if possibile) or with Newspaper 10.3.2. do I need a Child theme 10?

Thanks a lot!

Vlad S
tagDiv Staff

Hi,

Please make sure that you do not have a plugin conflict, please deactivate ALL plugins except tagDiv Composer, also if you are using child theme or cache plugin, deactivate them, clear all cache and try again.

If the problem persist, please set this code in functions.php -> wp-content/plugins/td-composer/legacy/Newspaper/functions.php
add_action('admin_head',function() {
echo '<style>.td-gutenberg-editor .editor-styles-wrapper .wp-block {max-width:726px;}</style>';
});

Or you can send us an email at contact@tagdiv.com and provide admin login, as well as cPanel or FTP if possible. We will take a look. Include a link to this topic in the email.

Thank you!

Vlad S
tagDiv Staff

Hi,

Please make sure that you do not have a plugin conflict, please deactivate ALL plugins except tagDiv Composer, also if you are using child theme or cache plugin, deactivate them, clear all cache and try again.

If the problem persist, please set this code in functions.php -> wp-content/plugins/td-composer/legacy/Newspaper/functions.php
add_action('admin_head',function() {
echo '<style>.td-gutenberg-editor .editor-styles-wrapper .wp-block {max-width:726px;}</style>';
});

Or you can send us an email at contact@tagdiv.com and provide admin login, as well as cPanel or FTP if possible. We will take a look. Include a link to this topic in the email.

Thank you!

netco
tagDiv Member

Hi Vlad,

Hope all is well and thank you for your input. Based on your recommendations, I figured out that the problem was in my child-theme. I had entered the code below in ‘functions.phpto help me change the translation of the day & months on the top bar and for some reason that was conflicting with my WP menus.

SCREENSHOT: https://ibb.co/MPFcNcS

That being said how do I translate the names of the days & months on that top bar without affecting my menus?

/* ----------------------------------------------------------------------------
translated month + days
*/
function change_data()
{
global $wp_locale;

// Months
$wp_locale->month['01'] = 'Enero';
$wp_locale->month['02'] = 'Febrero';
$wp_locale->month['03'] = 'Marzo';
$wp_locale->month['04'] = 'Abril';
$wp_locale->month['05'] = 'Mayo';
$wp_locale->month['06'] = 'Junio';
$wp_locale->month['07'] = 'Julio';
$wp_locale->month['08'] = 'Agosto';
$wp_locale->month['09'] = 'Septiembre';
$wp_locale->month['10'] = 'Octubre';
$wp_locale->month['11'] = 'Noviembre';
$wp_locale->month['12'] = 'Diciembre';

// Days
$wp_locale->weekday['0'] = 'Domingo';
$wp_locale->weekday['1'] = 'Lunes';
$wp_locale->weekday['2'] = 'Martes';
$wp_locale->weekday['3'] = 'Miercoles';
$wp_locale->weekday['4'] = 'Jueves';
$wp_locale->weekday['5'] = 'Viernes';
$wp_locale->weekday['6'] = 'Sabado';

// Months Abbreviation
$wp_locale->month_abbrev['January'] = 'Ene';
$wp_locale->month_abbrev['February'] = 'Feb';
$wp_locale->month_abbrev['March'] = 'Mar';
$wp_locale->month_abbrev['April'] = 'Abr';
$wp_locale->month_abbrev['May'] = 'May';
$wp_locale->month_abbrev['June'] = 'Jun';
$wp_locale->month_abbrev['Julie'] = 'Jul';
$wp_locale->month_abbrev['August'] = 'Ago';
$wp_locale->month_abbrev['September'] = 'Sep';
$wp_locale->month_abbrev['October'] = 'Oct';
$wp_locale->month_abbrev['November'] = 'Nov';
$wp_locale->month_abbrev['December'] = 'Dic';

}

add_filter('locale','change_data');

  • This reply was modified 6 years by netco.
zeroenigma
Participant
#0

We have a background ad skin campaign and are unable to use your build in image and link editor.

We are also trying to use advanced ads and running into the same issues.

We have this code:

Advertisement

or

Advertisement

or
<ins class=’dcmads’ style=’display:inline-block;width:1px;height:1px’
data-dcm-placement=’N30602.3753112BABELTECHREVIEWS/B23770327.270791322′
data-dcm-rendering-mode=’iframe’
data-dcm-https-only
data-dcm-resettable-device-id=”
data-dcm-app-id=”>
<script src=’https://www.googletagservices.com/dcm/dcmads.js’></script&gt;
</ins>

And none of them work. We have downloaded a manual image with the tracking code and not all resolutions show the image correctly. The theme is not being responsive and cropping the image or not showing it at all. At higher resolutions it looks perfect. What should we do?

As mentioned, we tried your built in method but it did not work. Advanced ads then suggested using this code:

add_filter( ‘advanced-ads-pro-background-selector’, ‘my_custom_background_selector’ );
function my_custom_background_selector(){
return ‘.main-container’;
}

in functions.php but this does not work in your theme.

Please help

Calin
tagDiv Staff

Hi,

For mobile theme plugin you actually need to set the code on functions.php from here wp-content/plugins/td-composer/mobile/functions.php unfortunately this file can not be set in child theme, the child is only for the theme, the settings made by you until no will apply on desktop and responsive version of mobile, but not on mobile theme plugin.

Thank you!

rajneeshhaldkar
tagDiv Member

can i copy all main theme file and past child theme except style.css & functions.php
can i change theme name,URI,Description,Author,Author URI or not (style.css)

Calin
tagDiv Staff

Hi,

No, you need to keep the parent theme, all you need to do is to copy the child the from the package you get from themeforest -> https://i.imgur.com/2fTR92h.png in your WordPress install, in themes -> https://i.imgur.com/7bGBKM9.png set the code in the functions.php file that is in the child theme -> https://i.imgur.com/fFlDjXb.png like in the above example, after that activate the child theme from Appearance > theme -> https://i.imgur.com/d7oZagD.png

Hope this will help you!
Thank you!

Calin
tagDiv Staff

Hi,

Please note that our theme support woocommerce, but this doesn’t mean that will have the features of a theme that is only for this, our theme use only what woocommerce plugin provide, also if you do not want to use the code, you can use some plugins to achieve what you need.
The above suggestion is taken from woocommerce documentation, also this code will apply only on woocommerce products and if you do not want to set it in the theme to do not harm it, you can use a child theme and set the code in the functions.php from child and then should be no problems.

Thank you for your understanding!

Calin
tagDiv Staff

Hi,

In order to achieve this option you need to set a code in them functions.php or in child theme functions.php the code is

add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );

The best will be to set the code in a child theme, if you set in in the main theme you need to set it in this functions.php wp-content/plugins/td-composer/legacy/Newspaper/functions.php -> https://i.imgur.com/DHrRfK1.png
Now you’ll have zoom on images, these will slide when you select and image.

Hope this will help you!
Thank you!

dita999
Participant
#0

I just upgraded to 10.3.1, and I can’t get child themes to work using a plugin or via FTP. Here’s what I have tried:

For all previous versions, I had been using the free version of the Child Theme Configurator plugin. I upgraded to the Pro version, and it says child themes should work when I analyze Newspaper. However, the site is completely broken when I preview/activate the child theme. I’ve tried changing the settings multiple times with the same result. This is a preview of the child theme (home page):

broken child theme

I have also tried adding the sample child theme via FTP to wp-content/themes/. Afterward, WordPress gives me an error saying I need to add a parent theme when I go to Appearances > Themes.

I only need a functions.php file in the child theme.

Live site is https://www.hungrypinner.com

Alan Feng
Participant
#0

Hi
How to use a hook in child theme with mobile theme activated?
I want to exclude some categories in mobile theme “Latest Article” post list (home page).
Any way to achieve this? In child theme functions.php?

thanks

Maddest
tagDiv Member

UPDATE: I’ve managed to solve the problem, by registering my CPT in the functions.php. Now the custom posts appear in the live results.

However, these custom post types are using attached thumbnails from external directories. They don’t show up in the result (which is not a surprise).
I see that the live results are using the ‘td_module_mx2’ template. Is it possible to overwrite it with a custom template, which I can store in the child theme directory? In this case I could use my own get image functions…

HeliR
Participant
#0

changing over my medium-sized health blog (2000 pages) to newspaper was almost painless

… unless …. the missing toggle and accordion function.

so here my solution

A) use plugin shortcodes-ultimate from Vlad A…

to make it much easier to call the toggles (and to be able to reuse my old websites source without any changes) I get the shortcode-call rewritten using a simple 3-liner php-function

I have all kind of tiny little php-functions that I collected over the years, to use all of them in my several pages I created my “own plugin” that carries those functions. You might just add following code to the newspapers child-theme functions.php

// for newspaper adding some toggle functions
function toggle_function( $atts , $content=null) {
extract( shortcode_atts( array(
'title' => '',
'class'=>'',
'style'=>'',
), $atts ) );

/* für shortcodes ultimate */

$ss = '[su_accordion][su_spoiler style="fancy" open="no" title="' . $title . '"]' . do_shortcode($content) . '[/su_spoiler][/su_accordion]';
return do_shortcode($ss);
}

add_shortcode( 'toggle', 'toggle_function' );
add_shortcode( 'toggle1', 'toggle_function' );
add_shortcode( 'toggle2', 'toggle_function' );
add_shortcode( 'toggle3', 'toggle_function' );
add_shortcode( 'toggle_framed', 'toggle_function' );
add_shortcode( 'toggleZ', 'toggle_function' );

by creating my own shortcode [toggle] [toggle1] [toggle2] [toggle3] …. I am able to have nested toggles

you just call them via

[toggle title="this is the toggles title"]
.... here is the text inside the toggle ....
[/toggle]

B) use plugin accordion shortcodes from Phil Buchanan

I actually use B in newspaper and had to use A for some different theme which messed up Phil’s plugin but was OK with Vlads plugin. I think that Vlads Shortcodes ultimate is easier and better integrated

use following functions.php addition


function toggle_function( $atts , $content=null) {
extract( shortcode_atts( array(
'title' => '',
'class'=>'',
'style'=>'',
), $atts ) );

/* für accordion shortcode */

$ss = '[accordion title="" open1st="0" openAll="0" style="toggle"][accordion_item title="' . $title . '"]' . do_shortcode($content) . '[/accordion_item][/accordion]';
return do_shortcode($ss);
}

add_shortcode( 'toggle', 'toggle_function' );
add_shortcode( 'toggle1', 'toggle_function' );
add_shortcode( 'toggle2', 'toggle_function' );
add_shortcode( 'toggle3', 'toggle_function' );
add_shortcode( 'toggle_framed', 'toggle_function' );
add_shortcode( 'toggleZ', 'toggle_function' );

here are some hints for some CSS that you add to your childs styles.css

/* Accordion Styles */
.accordion { margin: 18px 0px;border: solid lavender 6px;}
.accordion-title {margin:0;padding: 14px 14px 14px 20px;color:royalblue;cursor:pointer;font-weight:900;border-radius: 5px;overflow: hidden; border:1px solid gray;background:#f9f9f9;}
.accordion-title:hover {color:red;cursor: -webkit-grab; cursor: grab;font-weight:900;}

.accordion-title:before{content:”+ | “;width:49px;height:100%;border-width:0 0px 0 0;border-style:solid;text-align:left;}
.accordion-title:first-child {border: none;}
.accordion-title.open {cursor: default;}
.accordion-title.open:before {content:”- | “;width:49px;height:100%;border-width:0 0px 0 0;border-style:solid;text-align:left;}
.accordion-content {padding:20px 6px 15px 6px;background-color:whitesnow;}
/* Accordion Styles ende */

Optimyz
tagDiv Member

Thanks, but I tried as below,

1. Removed the child theme folder (Newsmag-child), then click the Appearance->Themes. We got 404.
2. Recreate Newsmag-child, copy style.css and functions.php from the Newsmag-child folder in the theme package. Same result, 404.

Any idea?

Sprint News
tagDiv Member

In the links you send me i can’t find how to update the Child Theme version with new one keeping customization we made on the actual child theme.

More info
Actual child theme version is named 1.1 in the style.css info and Newsmag 2.0 Child theme in the functions.php file info

Calin
tagDiv Staff

Hi,

Please make sure that you do not have a plugin conflict, please deactivate ALL plugins except tagDiv Composer, also if you are using child theme or cache plugin, deactivate them, clear all cache and try again.

If the problem persist, please set this code in functions.php -> wp-content/plugins/td-composer/legacy/Newspaper/functions.php
add_action('admin_head',function() {
echo '<style>.td-gutenberg-editor .editor-styles-wrapper .wp-block {max-width:726px;}</style>';
});

Or you can send us an email at contact@tagdiv.com and provide admin login, as well as cPanel or FTP if possible. We will take a look. Include a link to this topic in the email.

Thank you!

lucagrandicelli
Participant
#0

Dear support,
i need to check if a post belongs to a specific cloud template from within the child theme’s functions.php
Is there anything i can do to retrieve the tdb_template field containing the name of the template, not its ID?
Thank you.

Calin
tagDiv Staff

Hi,

Please make sure that you do not have a plugin conflict, please deactivate ALL plugins except tagDiv Composer, also if you are using child theme or cache plugin, deactivate them, clear all cache and try again.

If the problem persist, please set this code in functions.php -> wp-content/plugins/td-composer/legacy/Newspaper/functions.php
add_action('admin_head',function() {
echo '<style>.td-gutenberg-editor .editor-styles-wrapper .wp-block {max-width:726px;}</style>';
});

Or you can send us an email at contact@tagdiv.com and provide admin login, as well as cPanel or FTP if possible. We will take a look. Include a link to this topic in the email.

Thank you!

gumball44
tagDiv Member

Yep I need it.. If I deactivate mobile cache, it’s mobile them wich are deployed..not amp.. I face a huge problem.. Could you check my .htaccess and functions.php Child theme, I added some codes..maybe one of them is the problem ? no ?

  • This reply was modified 6 years by gumball44.
pavel_t
tagDiv Member

Thank you, that works! For possible followers – it needs only to change it into syntax with single quotes (‘in_same_term:true’)
I have 2 additional questions:
1) Is there a way how to implement these 2 parameters through functions.php in child theme, that means without repeating that procedure manually after every Template/Plugin update ?
2) What is roughly the time estimate when it will be implemented in the template – just to know, if eventual procedure with manual change of code after updates is for short time only or longer term necessity

Viewing 25 results - 176 through 200 (of 638 total)