jrothra

Member

Forum Replies Created

  • In reply to: Child file for footer.php?

    #15981

    Actually, as I look at what similar groups have done, they have no login info/meta on their site. So I may just scrap the “control panel”/meta info anyway. Admins will have the link to get into the site anyway.

    In reply to: How to change 'follow me' text on Twitter widget

    #15887

    Would the same rules apply to the loop.php and footer.php files as do to the functions.php file that you mentioned above (don’t add it all, just what I customize). If so, since my customizations in the loop.php are moving the location of the top social share buttons, and in the footer it’s adding a custom menu, how would I do that?

    Here’s my customizations (areas affected shown since that’s all I’ve changed):

    Loop.php File Changes

    Notice I’ve marked where the new location is as well as where the original location was, just for my future reference.

    <?php /* Post content */ ?>
    <!-- SOCIAL SHARING TEST LOCATION START -->
    <div id="socialsharing">
    <?php /* Social sharing buttons at top of post */ ?>
    <?php if (stripos($graphene_settings['addthis_location'], 'top') !== false) {graphene_addthis(get_the_ID());} ?>
    </div>
    <!-- SOCIAL SHARING TEST LOCATION END -->

    <div class="entry-content clearfix">
    <?php do_action('graphene_before_post_content'); ?>

    <?php if ((is_home() && !$graphene_settings['posts_show_excerpt']) || is_singular() || (!is_singular() && !is_home() && $graphene_settings['archive_full_content'])) : ?>

    <!-- SOCIAL SHARING ORIGINAL LOCATION -->
    <?php /* The full content */ ?>
    <?php the_content('<span class="block-button">'.__('Read the rest of this entry ร‚ยป','graphene').'</span>'); ?>
    <?php else : ?>
    <?php /* The post thumbnail */
    if (has_post_thumbnail(get_the_ID())) { ?>
    <div class="excerpt-thumb">
    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(esc_attr__('Permalink to %s', 'graphene'), the_title_attribute('echo=0')); ?>">
    <?php the_post_thumbnail(apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail')); ?>
    </a>
    </div>
    <?php
    } else {
    echo graphene_get_post_image(get_the_ID(), apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail'), 'excerpt');
    }
    ?>

    Footer.php Changes

    As with above, I’ve marked the beginning and end of what I’ve added.

    <?php if ( ! $graphene_settings['hide_return_top'] ) : ?>
    <li class="menu-item return-top"><a href="#"><?php _e('Return to top', 'graphene'); ?></a></li>
    <?php endif; ?>

    <!--ADDED BY JOHN START -->
    <li><a href="#">Control Panel</a>
    <ul class="sub-menu"><li><?php wp_register(); ?></li>
    <li><?php wp_loginout(); ?></li>
    <?php wp_meta(); ?>
    <!--LINK TO HOW TO VIDEOS FOR ADMINS ONLY-->
    <?php global $user_ID; if( $user_ID ) : ?>
    <?php if( current_user_can('level_10') ) : ?>
    <li><a href="http://www.greggcountygop.com/howto/">Instructional Videos</a></li>
    <?php endif; ?>
    <?php endif; ?>
    <!--END LINK TO HOW TO VIDEOS FOR ADMINS ONLY--></ul></li>
    <!--ADDED BY JOHN END -->

    </ul>

    </div>

    <div id="developer">
    <p>
    <?php /* translators: %1$s is the link to WordPress.org, %2$s is the theme's name */ ?>
    <?php printf(__('Powered by %1$s and the %2$s.', 'graphene'), '<a href="http://wordpress.org/">WordPress</a>', '<a href="http://www.khairul-syahir.com/wordpress-dev/graphene-theme">' . __('Graphene Theme', 'graphene') . '</a>'); ?><br />Customized by <a href="http://www.jrothraministries.com>" target="_blank">John L. Rothra</a>.
    </p>

    <?php do_action('graphene_developer'); ?>
    </div>

    In case you’re wondering why I have the code to limit a link to Admins only, I do have a plugin that will block a page or post to people unless they are logged in as a Admins. However, I don’t want the link to that page showing up at all unless the person is logged in as an admin. Whether the link was put in the regular menus or added to the Meta widget, it would be visible to anyone who logs in regardless of their level. I wanted to hide the link from anyone except admins, hence this coding.

    In reply to: How to change 'follow me' text on Twitter widget

    #15886

    Ken,

    I did read that page and it was a bit confusing, especially since it seemed to focus on the CSS file, and my questions are more about the other files. Also, it tends to be a bit technical, a downside to WP “walkthroughs” for those of us not as familiar with coding language. Syahir, though, has been extremely helpful and seems to try to explain things in terms we can all understand. ๐Ÿ™‚ For that I’m very grateful.

    In reply to: How to change 'follow me' text on Twitter widget

    #15883

    When I removed the customized functions.php file from the child theme folder, things worked better (though the changes I made to the things such as the header and options (all using the WP Dashboard based interface) were undone, such as my custom header banner, custom menu. I never changed the functions.php folder in the parent directory.

    In reply to: How to change 'follow me' text on Twitter widget

    #15881

    I tried that, but when I went to activate the child theme, I got this warning:

    Warning: require_once(admin/options-defaults.php) [function.require-once]: failed to open stream: No such file or directory in /home/gcgop/public_html/wp-content/themes/graphene-child/functions.php on line 53

    Fatal error: require_once() [function.require]: Failed opening required ‘admin/options-defaults.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/gcgop/public_html/wp-content/themes/graphene-child/functions.php on line 53

    The code you mentioned I placed near the top of the file, changing nothing else. Here’s the code to my functions.php file that shows line 53 and where I placed the customization.

    <?php
    /**
    * Graphene functions and definitions
    *
    * Sets up the theme and provides some helper functions. Some helper functions
    * are used in the theme as custom template tags. Others are attached to action and
    * filter hooks in WordPress to change core functionality.
    *
    * The first function, graphene_setup(), sets up the theme by registering support
    * for various features in WordPress, such as post thumbnails, navigation menus, and the like.
    *
    * When using a child theme (see http://codex.wordpress.org/Theme_Development and
    * http://codex.wordpress.org/Child_Themes), you can override certain functions
    * (those wrapped in a function_exists() call) by defining them first in your child theme's
    * functions.php file. The child theme's functions.php file is included before the parent
    * theme's file, so the child theme functions would be used.
    *
    * Functions that are not pluggable (not wrapped in function_exists()) are instead attached
    * to a filter or action hook. The hook can be removed by using remove_action() or
    * remove_filter() and you can attach your own function to the hook.
    *
    * We can remove the parent theme's hook only after it is attached, which means we need to
    * wait until setting up the child theme:
    *
    * <code>
    * add_action( 'after_setup_theme', 'my_child_theme_setup' );
    * function my_child_theme_setup() {
    *
    * remove_filter('filter_hook', 'callback_function' );
    * ...
    * }
    * </code>
    *
    * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API.
    *
    * @package WordPress
    * @subpackage 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 ); }

    /**
    * Retrieve the theme's user settings and default settings. Individual files can access
    * these setting via a global variable call, so database query is only
    * done once.
    */
    require_once( 'admin/options-defaults.php' );
    function graphene_get_settings(){
    global $graphene_defaults;
    $graphene_settings = array_merge( $graphene_defaults, (array) get_option( 'graphene_settings', array() ) );
    return apply_filters( 'graphene_settings', $graphene_settings );
    }
    global $graphene_settings;
    $graphene_settings = graphene_get_settings();

    /* CUSTOMIZATION BY JLR START - CHANGE WORDING OF LINK AT BOTTOM OF TWITTER WIDGET */
    function graphene_filter_gettext( $translated, $original, $domain ) {
    $strings = array(
    'Follow me on Twitter' => 'Follow GCGOP on Twitter',
    );
    if ( ! empty( $strings[$original] ) ) {
    $translations = &get_translations_for_domain( $domain );
    $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
    }
    add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );
    /* CUSTOMIZATION BY JLR END - CHANGE WORDING OF LINK AT BOTTOM OF TWITTER WIDGET */

    /**
    * If there is no theme settings in the database yet (e.g. first install), add the database entry.
    */

    Here’s what’s in my child folder:

    – footer.php

    – functions.php

    – gcgop.ico

    – loop.php

    – style.css

    – images/img_slider_generic.png

    – images/sprite_h-JLR.png

    – images/sprite_h_light-JLR.png

    The child theme worked fine until I copied the parent theme’s functions.php file, added the code you mentioned, and saved the customized version into the child folder (leaving the parent unchanged).

    In reply to: How to change 'follow me' text on Twitter widget

    #15879

    Syahir,

    Where in the child’s functions.php file do I throw it?

    In reply to: How to modify the theme using a child theme

    #10923

    Okay, I’m missing something. In the “themes” directory, I created a folder called “graphene-child-byJLR” and put the following files in it:

    – loop.php (because I moved where the top social sharing buttons go)

    – style.css

    – images/sprite_h-JLR.png (changed some of the colors)

    – images/sprite_h_light-JLR.png (changed some of the colors)

    Here’s what that CSS file has in it:

    /*
    Theme Name: Graphene Child
    Theme URI: http://www.khairul-syahir.com/wordpress-dev/graphene-theme
    Description: Child theme for the Graphene theme
    Author: John L. Rothra
    Author URI: http://www.jrothraministries.com/
    Template: Graphene Custom by John L. Rothra
    Version: 1.0
    */
    @import url("../graphene/style.css");

    /* =Non-classed HTML elements
    */

    body {
    background: url(images/bg-red-gradiant.png) repeat-x #ae0101 fixed;
    }

    /* =Header
    */

    #top-bar {
    background: url(images/sprite_h-JLR.png) left -196px repeat-x #313130;
    }

    /* =Navigation
    */

    .menu-bottom-shadow{
    background: url(images/sprite_h-JLR.png) left top repeat-x #eee;
    }

    #header-menu {
    background: url(images/sprite_h-JLR.png) left -3px repeat-x #101010;
    }

    #header-menu > li:hover,
    #header-menu > li.current-menu-item,
    #header-menu > li.current-menu-ancestor {
    background: url(images/sprite_h-JLR.png) left -100px repeat-x #eee;
    }

    #header-menu ul li {
    background: url(images/sprite_h-JLR.png) left -377px repeat-x #dfdfdf;
    }

    #secondary-menu {
    width: 100%;
    background: url(images/sprite_h-JLR.png) left -540px repeat-x #222;
    }

    #secondary-menu > li:hover,
    #secondary-menu > li.current-menu-item,
    #secondary-menu > li.current-menu-ancestor {
    background: url(images/sprite_h-JLR.png) left -614px repeat-x #dfdfdf;
    }

    #secondary-menu ul li {
    background: url(images/sprite_h-JLR.png) left -614px repeat-x #dfdfdf;
    }

    /* =Content Area
    */

    .post-title,
    .post-title a,
    .post-title a:visited {
    font: 24px arial;
    }

    blockquote p {
    color: #1a1a1a !important;
    }

    /* =Post Formats
    */

    .post-format .entry-header{
    background: url(images/sprite_h-JLR.png) left -261px repeat-x #598ead;
    }

    /* =Footer
    */

    #footer {
    background: url(images/sprite_h-JLR.png) left -952px repeat-x #0a273f;
    }

    .footer-menu-wrap ul.sub-menu {
    border-left: 1px solid #222;
    }

    I only slightly modified the file names for my own easier reference to the original.

    ** The Problem **

    When I refreshed the templates screen in WP to be able to activate the child theme, it is not listed at all, but FileZilla shows that the files are there. I even tried logging out and logging back in. What did I do wrong?

    **** EDIT ****

    I found the problem, I think. Re-reading the WP page to which you link in the OP, I have the wrong name under “Template.” Oops.

    In reply to: How to modify the theme using a child theme

    #10922

    I just want to make sure I understand things right since I’m new to the ‘child theme’ concept. To customize the theme:

    1. Create a new theme directory within the “wp-content/themes” directory, call it whatever I want (e.g., Graphene-edited).

    2. Place the CSS file in there with the stuff you mentioned in the first post.

    3. Anything I want to change in the original CSS, add it to the new ‘child’ CSS.

    4. If I change the sprite images, call give them a new name (e.g., sprite-master-edited.png) and add the appropriate css calls in the new child CSS file.

    5. Activate the child theme.

    But I’m still confused on two things: First regarding certain files, such as the “loop.php” file. I moved the location of where the top social sharing icons will be placed. It now looks like this:

    <?php /* Post content */ ?>
    <!-- SOCIAL SHARING TEST LOCATION START -->
    <div id="socialsharing">
    <?php /* Social sharing buttons at top of post */ ?>
    <?php if (stripos($graphene_settings['addthis_location'], 'top') !== false) {graphene_addthis(get_the_ID());} ?>
    </div>
    <!-- SOCIAL SHARING TEST LOCATION END -->

    <div class="entry-content clearfix">
    <?php do_action('graphene_before_post_content'); ?>

    <?php if ((is_home() && !$graphene_settings['posts_show_excerpt']) || is_singular() || (!is_singular() && !is_home() && $graphene_settings['archive_full_content'])) : ?>

    <!-- SOCIAL SHARING ORIGINAL LOCATION -->
    <?php /* The full content */ ?>

    Do I create a “loop.php” file in the child theme directory in the same place the original one would respectively go?

    Second thing I’m confused about: if I update the theme (when updates come), will this impact the child files such as the loop.php file?

    In reply to: Better Blockquotes "Classy Quote"

    #12951

    I love the idea of the close quote, but I can’t get it to work. I haven’t changed any of

    blockquote span {
    display: block;
    background-image: url(images/blockquote-closequote2.png);
    background-position: bottom right;
    background-repeat: no-repeat;
    }

    It’s based on the code give above combined with looking at the Classy Quote site mentioned. I’ve created two alternate close quote images. Both flip the original image, but one is the same exact size, one is only the close quote:

    blockquote-closequote1.png

    blockquote-closequote2.png

    Did I mis-code something?

    In reply to: Facebook like buttons off center from Others

    #15818

    You’re right that most wouldn’t ever notice it, but it was getting on my nerves. Inside the

    Code:
    <fb:like … >

    lime of Facebook’s button code I added

    Code:
    style=”bottom:2px;”

    . That brought it up to be even. ๐Ÿ™‚ Not a perfect fix, but an effective enough one.

Viewing 10 posts - 41 through 50 (of 57 total)