Search Results for 'child theme'

Results from the Forum
fanasp
Participant
#0

Hi,

We’ve set up a child theme, but the layout of the pages breaks. When reverting back to the parent theme, everything is back to normal.

The child theme’s functions enqueueing:
function my_theme_enqueue_styles() {

$parent_style = 'parent-style';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style )
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );

Style.css
*
Theme Name: Newspaper Child theme
Description: Fana Sparebank intranett tema
Author: Fana Sparebank
Author URI: Author
Template: Newspaper
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
*/

Is there something missing in our child theme setup? The folder name of the child theme is “Nespaper-child” with no spaces.

Best regards

Bogdan B.
tagDiv Staff

Hi,

Unfortunately, Yes as there is no update proof way of altering the theme files. You could use a child theme but even that is not update proof. You will still have to keep an eye out if the file was changed in an update and if it is, you will have to change it in the child theme as well, but it will spare you a couple of updates until we change the post files (they will not get changed too often hopefully)

Thank you!

Bogdan B.
tagDiv Staff

Hello,
Maybe something went wrong when installing the theme or when creating a child theme. If you use a child theme please revert to the main theme or if the main theme provides this error as well, then try to re-install it by using this method: https://forum.tagdiv.com/install-via-ftp/
Let us know if you still have trouble with this.
Thank you!

Cogdiss
Participant
#0

Hi,

A site I run the Newspaper Theme on is running a background-ad over the weekend. I’ve set up the background image and the URL, but they’ve asked me to add an Impressions tag as well.

They’ve provided this in three ways; firstly as an tag, which I’m assuming I can’t use because we need to add the image URL through the theme panel, secondly as an iFrame code which I’m assuming again I can’t use because there isn’t an iframe being used, and thirdly as a javascript code.

The Javascript code looks like this (I’ve removed part of the URL):

<SCRIPT language=’JavaScript1.1′ SRC=”https://ad.doubleclick.net/ddm/trackimpj/tracking-code-etc;dc_trk_aid=xxx;dc_trk_cid=xxx;ord=%5Btimestamp%5D;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=?”></SCRIPT&gt;

In the Newspaper Theme Panel there is an area for custom JS but it says the opening and closing <script> tags need to be removed. I wasn’t sure how to do that with this code, as the impressions bit is within the opening tag.

Are you able to let me know how I can use this code with a background image?

Thanks!

Hannah

Catalin
tagDiv Staff

Hello esplota,

The Child Theme is used when you want to add some additional customizations and you do not want to affect the code from the main theme. Before you begin to make a child theme, please consult our documentation in this regard, here -> https://forum.tagdiv.com/the-child-theme-support-tutorial/ and there you will see which type of elements could be overwritten in child theme and which not.

Thanks for your understanding!

esplota
Participant
#0

Hi,

Before messing up the Theme, just wanted to make sure if we can create a child theme or we need to take additional considerations?

If so, please provide a way

Many thanks!

Danny Froberg
tagDiv Member

Did you test enabling the Newspaper-child that comes bundled?

It’s identical to the previous ones for 7.x;

add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 1001);
function theme_enqueue_styles() {
wp_enqueue_style('td-theme', get_template_directory_uri() . '/style.css', '', '6.1c', 'all' );
wp_enqueue_style('td-theme-child', get_stylesheet_directory_uri() . '/style.css', array('td-theme'), '6.1c', 'all' );

}

Is there anything else that should be in there that is not?

scorpiock
Participant
#0

Hello,

How do I completely remove fonts being loaded from theme panel and load my custom fonts?

I see you have custom font options in theme panel but no options to specify eot, ttf, etc.

I created child theme and put css in style.css but it was not loading the fonts so need the best way to do this.

Catalin
tagDiv Staff

Hello Danny Froberg,

Yes, this could be a reason in this regard. Please notice that you will have to use the Newspaper Child theme version which comes bundled with the new update in order to achieve best results in theme. You will have to try to copy all the customization from your old child theme and then paste them in the new version of the Child theme and check the results.

Hope this helps and let us know how it goes!

Thanks for your understanding!

Danny Froberg
tagDiv Member

It does not seem to be plugin related at all, but rather related to child themes.
Can you try replicating it by activating the standard Newspaper-child?

Bogdan B.
tagDiv Staff

Hi,
This could be a plugin conflict so please disable all plugins except visual composer, clear cache and reset cdn files. Then test the search option again. Also if you use a child theme please switch to the main theme and if you have any customization done to the main theme, please try to restore the theme to it’s default code to see if the custom code does not affect the search option.
Let us know how it goes.
Thank you!

Andrei L.
tagDiv Member

HI

Try this css in theme panel > custom code > custom css: http://screencast.com/t/WY5ZMP5AhX

.sf-menu .td-normal-menu:first-child > ul {
top: auto;
}

Let me know how it goes.
Thanks!

Andrei L.
tagDiv Member

HI

If you’re using child theme the code must be added in theme panel > mobile theme > custom code. You can ignore the warning because that code will work fine.

Thanks!

planetcappe
tagDiv Member

Thanks for your reply.
In this way it seems that comment form is only visible for articles that already had comments, in other articles it disappears.
P.S.: I copied the file comments.php in the root of child theme.

Andrei L.
tagDiv Member

Hi

To remove the gradient from big grid try this css in theme panel > custom coe > custom css: http://screencast.com/t/W06SuDaYLE

.td-grid-style-1 .td-module-thumb a:last-child:before{
background: none;
}

Thanks!

Bogdan B.
tagDiv Staff

Hi,

1) A module is the base element in our theme. Every block is simply a container of 1 or more modules. In this section of the theme paenl you can see exactly what module is used on what block: http://screencast.com/t/uHbbrmqWCXr
If you want to be more specific about it, you can find out faster by using the browser inspector. For example on a block 1, the small thumbnails: http://screencast.com/t/bkbqegiM2. The small module is a module 6. It’s module 6 you have to edit. The screenshot had module 5 highlighted (my bad) but it is module 6 being edited if you look here: http://screencast.com/t/MWULaIJuoTW. Sorry for the confusion.

2) The black header color shows up when your site gets a bit heavier on the loading speed. Css works in cascades and if you use for example css optomization tools that move the css render block to the footer, then you will be able to see each stept of the css re-write on the first load. The solution for this will be to change the css directly in style.css so there will not be any re-writes done to the file. This is the default css behavior and happens on every theme. An easy way to do it without too much searching is to simply access the page source and copy all of the rendered css directly in style./css at the bottom of the file: http://screencast.com/t/Oym8Cldak (it’s a big list. Copy everything between the ‘style’ tags)

3) The font is not bold in the left big thumb, but rather the font increased. If I increase the font for the small thumbs as well, it will also look bold. You can target them with css like so:
.td_module_6 .entry-title{
font-weight: 600!important;
}

4) Well the widgets are not the same height so you will need a bit of css customization to adjust the different margins to the containers to match the center widget. But adding more content to these sections will cause them to position differently again.
For the current layout you can use this code to make them align :
.widget_display_topics{
margin-bottom: -22px!important;
}
.widget_display_forums{
margin-bottom: -36px!important;
}

However I cannot guarantee this solution can be a viable one if the content of these widgets changes. All widgets are dynamic so longer titles will make them ‘fall’ below again

5) You can align the instagram text by adding this css code:
@media(max-width: 767px){
.td-footer-instagram-container .td-footer-instagram-title .td-footer-instagram-user-link{
display:initial!important;
}}

6)You can make the search text bigger by using this code:
.td-search-wrap-mob .td-search-input span{
font-size: 30px!important;
}

7) If you want to redirect the login to the bbpress login ,you can use simple 301 redirects and simply redirect the default login to the bbpress forums, but i;m not sure exactly how the login will work then. So maybe you will want a redirect after the login is made. So a user logs in ad is imediatly redirected to the forums maybe, Thait is doen with plugins as our theme dopes not have any such options.

8) That is because there were a few css changes and the code you had in your custom css needed to be more specific. Such things happen afet an update as css gets changed all the time. That is why the custom css code you apply needs to be very specific or some other more specific code we may add in a new update could overwrite it.

9)The big grid can be set as a full box if you remove the 2 pixels margin like so :
@media (max-width: 767px){
.td_block_big_grid_12 .td-big-grid-wrapper .td-big-grid-post:last-child .td-module-thumb {
margin-left: 0px!important;
}}

10) I’m not sure the code you entered is valid or not, you will have to get a proper ad code from the ad provider and then wrap it into these div elements like this topic suggests: https://forum.tagdiv.com/using-other-ads-non-adsense-ads/

Thank you!

Bogdan B.
tagDiv Staff

Hello,
Unfortunately if you want to place a widget on the homepage you will have to edit the theme files as there is no setting for it in the theme. You can edit the page template itself or even create a custom page template you can add code to. https://forum.tagdiv.com/topic/overriding-page-pagebuilder-latest-php-in-child-theme
Then after you create your new page template (a copy of one of the existing template), you can use a do_shortcode function in the file to add content to it: https://developer.wordpress.org/reference/functions/do_shortcode/
You can also use standard html and php if you have the proper coding knowledge. If you need help with the code needed, you will have to get some hired help as we cannot offer any custom work at the moment.
Thank you!

Bogdan B.
tagDiv Staff

Hi,

If you want to change a function from functions.php then it gets a bit more complicated as the functions.sphp will not re-write the function in the main theme. You will have to set priorities for them. Maybe this guide will help you understand better how this works: http://code.tutsplus.com/tutorials/a-guide-to-overriding-parent-theme-functions-in-your-child-theme–cms-22623

Thank you!

Andrei L.
tagDiv Member

Hi

If you change only the css then is not necessary to use the child theme because your custom css can be added in theme panel > custom code > custom css.
Child theme become useful if you want to change some of theme’s files, for example if you want to change a post template or change some functionality of a specific feature. Note that you will need some codding skills and experience with wordpress in order to setup a child theme and make some customizatins there.

Thanks!

francesr
Participant
#0

I have just downloaded Newsmag and wonder if it is necessary or more beneficial for me to use the child theme. I am editing within the given styles etc., so will my customisations be preserved with updates? I will take regular backups and it seems to me reading past posts on child theme issues, that it has complications which I would like to avoid. Reading documentation guides on when it is advisable to use a child theme, it is unclear to me exactly when it is not necessary to use the child theme at all. Hoping you can provide me with some clarity.
Many thanks

frankwl
tagDiv Member

Excellent. Good to learn.

Final question:
when changing this in the parent-theme files it is not update safe.

Can I overwrite that function in my child-theme functions.php?


if ( ! function_exists( 'get_item_scope' ) ) :
function get_item_scope() {
//show the review meta only on single posts that are reviews, the rest have to be article (in article lists)
// if ($this->is_review && is_single()) {
// return 'itemscope itemtype="' . td_global::$http_or_https . '://schema.org/Review"';
// } else {
// return 'itemscope itemtype="' . td_global::$http_or_https . '://schema.org/Article"';
}

Andrei L.
tagDiv Member

HI

We do recommend to use the child theme but it must be updated and compatible with the main theme’s version used. We don’t change the child theme very often but once in a while that is’s also updated. Try to update the child theme to the version included in theme’s path, re-add your customizations and also check them to be compatible with V 7.2 of main theme, then test the site again.

Thanks!

Bogdan B.
tagDiv Staff

Hi,
You can find the names for the theme and child-theme here: http://screencast.com/t/8tRbkTUjR6o1 and http://screencast.com/t/mxlR0c7BVo
Style.css is the one holding the name of the themes.
Thank you!

omarfilip
tagDiv Member

Never mind – My child theme has an older version of the header.php file. Problem is solved.

sbackholm
tagDiv Member

Andrei,

Thank you. That worked. So do you not recommend using child themes? We had made some header modifications that we wanted to preserve, but if Child Themes are just going to get in the way we won’t use them with your theme.

Thanks, again.

Regards,
Stephen

Viewing 25 results - 10,801 through 10,825 (of 12,866 total)