Forum Replies Created
-
Author
-
dunnyukParticipantCOPY CODE
@media only screen and (max-width: 767px) { .reveal-modal .button.facebook { float: none; width: 175px; height: 45px; margin-left: -4%; } }
dunnyukParticipantthe fuctions.php in the main sweetdate theme folder is different from the child theme fuctions.php only in its content, or lack of…
the child theme version is a blank canvas so to speak because of this ->
——————————————————————————————————————–
A child theme consists of at least one directory (the child theme directory) and two files (style.css and functions.php), which you will need to create:Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. Instead, it is loaded in addition to the parent’s functions.php. (Specifically, it is loaded right before the parent’s file.)
https://codex.wordpress.org/Child_Themes
——————————————————————————————————————-so the original is a “full” file so to speak and the child one just has a few needed php lines within which to add things. that would be why if you copied the whole file over to the child – wordpress spat its dummy….
child theme function.php supplied with theme.
COPY CODE<?php /** * @package WordPress * @subpackage Sweetdate * @author SeventhQueen <themesupport@seventhqueen.com> * @since Sweetdate 1.0 */ /** * Sweetdate Child Theme Functions * Add extra code or replace existing functions */ ?>
then lets say you need to edit a different file all you do is copy the file from the main theme and place it in the child theme folder – making sure you copy the folder structure – then make your edits to it and it will override the original – leaving it safe to update at a later date.
7thqueen have been nice enough to make the child theme for us – im using it and everythings going fine for me so far.(its my first time using a child theme)
so my take on it is – the functions.php is for making sitewide changes, and for more specific changes – find the file you need to change then copy it to the child and the folder structure its in then edit away…
that 1 page linked up there tells you all you need to know. give it a read.(it will take you 10 mins max)
so your index.php – copy it – place it in the child theme folder in the same place as the original and that should be it.
hope this helps.dunnyukParticipantthe original fuctions.php is in – your downloaded files, main files, wordpress, sweetdate-child.
heres mine………… (im not staff here – just a user like yourself)
COPY CODE<?php /** * @package WordPress * @subpackage Sweetdate * @author SeventhQueen <themesupport@seventhqueen.com> * @since Sweetdate 1.0 */ /** * Sweetdate Child Theme Functions * Add extra code or replace existing functions */ /** * Redirect buddypress and bbpress pages to registration page */ function kleo_page_template_redirect() { //if not logged in and on a bp page except registration or activation if( ! is_user_logged_in() && ( ( ! bp_is_blog_page() && ! bp_is_activation_page() && ! bp_is_register_page() ) || is_bbpress() ) ) { wp_redirect( home_url( '/register/' ) ); exit(); } } add_action( 'template_redirect', 'kleo_page_template_redirect' ); add_action('after_setup_theme','kleo_my_hearts_actions'); function kleo_my_hearts_actions() { /* disable matching on member profile */ remove_action('kleo_bp_before_profile_name', 'kleo_bp_compatibility_match'); /* Replace the heart over images */ add_filter('kleo_img_rounded_icon', 'my_custom_icon'); /* Replace the heart from register modal */ add_filter('kleo_register_button_icon', 'my_custom_icon_register'); /* Replace the heart from About us widget */ add_filter('kleo_widget_aboutus_icon', 'my_custom_icon_about_widget'); } /* Replace the heart with a camera icon function */ function my_custom_icon () { return 'camera'; } /* Replace the heart from register modal with a user icon function */ function my_custom_icon_register () { return 'user'; } /* Replace the heart from about us widget with a user icon function */ function my_custom_icon_about_widget () { return 'user'; } ?>
Attachments:
You must be logged in to view attached files. -
AuthorPosts