Adding code to WP file
-
I want to insert code to reverse the language button on the menu bar. It mentioned to add the code to functions.php.
Where do I find it? It this the proper place?
Mod
You need to create a child theme and then add that code to your child theme’s functions.php file.
I have the following code in my child theme style.css. Help.
Theme Name: Graphene Child
Theme URI: http://share-memories.com/
Description: Child theme for the Graphene theme
Author: RJL
Author URI: http://share-memories.com/about/
Template: graphene
Version: 1.0
*/
@import url("../graphene/style.css");
/* Your modification goes here */Mod
You will need to create another file and name it
functions.php
The contents of that file should look like this:
<?php
// Insert custom functions here
?>Upload that file to your child theme folder on your server.
Mod
Put code in between backtick (
Code:`) characters. It’s usually located above the Tab key on your keyboard. I have fixed this in your post.
What code?
I created the grapheme child theme on my bluehost.com.
The new website is all in disarray.
I managed to insert my header.
However, my menu bar is vertical vs. horizontal.
Page width too wide.
I now get <?php // Insert custom functions here ?> on by page.
share-memories.com
Raynald
Mod
Where did you upload the functions.php file to? You should have uploaded it to your child theme folder.
II have it in the Graphene Child folder.
When I open the file In addition to the code you mentioned I have the following
Sendmail frozen configuration – version ert custom functions here showing up on by home page.
[img]http://Users/eileenleblanc/Desktop/screen-capture-2.png[/img]
Mod
Your child theme style sheet does not contain the theme information or an
@import
statement. That is why your site looks odd.Try posting the content of your functions.php file here (between backticks, please).
I copied the functions.php from Graphene folder and added to my Graphene Child directory.. I get Error 500 for my efforts.
<?php
/**
* Graphene WordPress Theme, Copyright 2010-2012 Syahir Hakim
* Graphene is distributed under the terms of the GNU GPL version 3
*
* Graphene functions and definitions
*
* @package Graphene
* @since Graphene 1.0
*/
/**
* Before we do anything, let's get the mobile extension's init file if it exists
*/
$mobile_path = dirname( dirname( __FILE__ ) ) . '/graphene-mobile/includes/theme-plugin.php';
if ( file_exists( $mobile_path ) ) { include( $mobile_path ); }
/**
* Load the various theme files
*/
global $graphene_settings;
require( get_template_directory() . '/admin/options-init.php' ); // Theme options and admin interface setup
require( $graphene_settings['template_dir'] . '/includes/theme-scripts.php' ); // Theme stylesheets and scripts
require( $graphene_settings['template_dir'] . '/includes/theme-utils.php' ); // Theme utilities
require( $graphene_settings['template_dir'] . '/includes/theme-head.php' ); // Functions for output into the HTML <head> element
require( $graphene_settings['template_dir'] . '/includes/theme-menu.php' ); // Functions for navigation menus
require( $graphene_settings['template_dir'] . '/includes/theme-loop.php' ); // Functions for posts/pages loops
require( $graphene_settings['template_dir'] . '/includes/theme-comments.php' ); // Functions for comments
require( $graphene_settings['template_dir'] . '/includes/theme-widgets.php' ); // Functions for custom widgets
require( $graphene_settings['template_dir'] . '/includes/theme-slider.php' ); // Functions for the slider
require( $graphene_settings['template_dir'] . '/includes/theme-panes.php' ); // Functions for the homepage panes
require( $graphene_settings['template_dir'] . '/includes/theme-plugins.php' ); // Native plugins support
require( $graphene_settings['template_dir'] . '/includes/theme-shortcodes.php' ); // Theme shortcodes
require( $graphene_settings['template_dir'] . '/includes/theme-webfonts.php' ); // Theme webfonts
require( $graphene_settings['template_dir'] . '/includes/theme-functions.php' ); // Other functions that are not categorised above
require( $graphene_settings['template_dir'] . '/includes/theme-setup.php' ); // Theme setup
<?php
- You must be logged in to reply to this topic.