Adding code to WP file

  • Anonymous


    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?


    Kenneth John Odle


    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:
    Description: Child theme for the Graphene theme
    Author: RJL
    Author URI:
    Template: graphene
    Version: 1.0

    @import url("../graphene/style.css");
    /* Your modification goes here */

    Kenneth John Odle


    You will need to create another file and name it functions.php

    The contents of that file should look like this:


    // Insert custom functions here


    Upload that file to your child theme folder on your server.


    Kenneth John Odle


    Put code in between backtick (


    ) 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

    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.



    Kenneth John Odle


    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.



    Kenneth John Odle


    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.


    * 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


Viewing 10 posts - 1 through 10 (of 34 total)

  • You must be logged in to reply to this topic.