Graphene Custom Functions

These are custom functions specific to the Graphene Theme.  I needed a place to store all the functions that I come across (or create) to extend the functionality of the Graphene Theme.
[break]

Limit Words in the Excerpt Areas

This function will control the count of words (not characters) in the excerpt areas.

function custom_excerpt_length($length) {
 return 55; // Change this word count to whatever you want.
}
add_filter('excerpt_length', 'custom_excerpt_length', 20 );

[break]

Change Dimensions of the Front Page Header Image

This function will adjust the width and height of the header image.

function graphene_custom_header_width(){
   return 960;  // The value of your custom width
}
function graphene_custom_header_height(){
   return 157;  // The value of your custom height
}
add_filter('graphene_header_image_width', 'graphene_custom_header_width');
add_filter('graphene_header_image_height', 'graphene_custom_header_height');

And this must be added to your child theme or custom css.

#header {
    width: 960px;  /* Must match value above */
    height: 157px;  /* Must match value above */
}

[break]

Change Default Text Strings

This function can help you change the text in hard coded text lines. For example, the “View Full Post” button, or the “Leave a Comment” link. NOTE: If you use this function for more than one translation, you will need to adjust the function name for each one to be unique.

function graphene_filter_gettext( $translated, $original, $domain ) {
	$strings = array(
		'View full post' => 'Read More', // "View Full Post" should be changed to the exact string you want to replace; "Read More" should be the exact string you want to use.
	);
	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 );

7 Responses to Graphene Custom Functions

  1. Robert says:

    Hey Josh, my paging problem is back, throwing the sidebar under the post!, I’m currently working ELI Related Post on the excerpt problem!

    ELI’s Related Posts Footer Links and Widget
    Settings | Deactivate | Edit

    This Plugin creates links to Related Post at the bottom of every post. There is also a Widget for your WordPress sidebar or footer area. Links can be displayed in a Tree View or as a Simple List and can be related by Tags or by Category.
    Version 1.2.04.07

    Ultimate TinyMCE
    Settings | Support Forum | Deactivate | Edit

    Beef up your visual tinymce editor with a plethora of advanced options.
    Version 1.7.9 | By Josh Lobe | Visit plugin site | Donate

    1. Updated both the same day and then my problems where back! I get a 404 error clicking your UTM link from the Admin Menu Bar!
    2. When ELI is activated, the slider excerpt stops working and the same Welcome message in on every slide under the post header.
    3. Using the and paging feature on the post page, the sidebar is placed under the post as before!
    4. I have post with paging that work before the updates; on April 11th paging worked see: http://ogahome.com/DLU/?page_id=3272
    5. Maybe the updates of the ELI & UTM April 11 or 12.
    Question…with these update should I be using the Child because I didn’t use it or is this only for the Theme Upgrades?
    I know you’re getting sick of this as I am! Smile!

    • Debangita says:

      Hello !Actuellement j’utilise WP 2.0.1 FR tout marche plus au moins au mieux mise e0 par 2 bugs :Akismet : API key not vadile bla bla bla; j’utilise donc Spam Karma 2TinyMCE: ce wysiwyg ne fonctionne pas chez moiAvant de passer e0 WP 2.0.2 FR, je de9sire savoir si ces bugs ont pu eatre re9solusSi ceux ne sont pas des bugs que puis je faire ?Je met un profil pour que vous puissiez voir l’absence de TinyMCElogin : wp201frpass: wp201frMise e0 par e7a ce site est tre8s pratique, merciJ’aimerais contribuer aussi donc voile0Salut e0 tous et toutesfabian

  2. Robert says:

    Josh, I’m not clear on this…I am assuming that you’re saying that I should use these functions? How, where, do I replace the functions in the child or main theme? I will save these functions as and look at them! It looks like you’re using the ELI navigation here! Right? My problem started sometime ago, I just started using the ELI Navigation in the sidebar! It’s the ELI excerpts within the post that causes the problem. If I remove/deactivate it…problem solved!

  3. Sam says:

    Thank you so much for the Graphene custom header information. I have been looking for this all over the place. O am still having issues where I cannot change the height of the top main image without pushing my text title to the bottom. Thank you for the information.

  4. Cathy Espere says:

    Been trying to reach you regarding a graphene issue. Did you get my email? Thanks so much, Cathy

  5. Robert says:

    Hi Josh, I use Ultimate TinyMCE, but having problems with long post…looking to break them up into pages like next page! In using the next page icon…on preview the page go blank (black)! Any suggestions? I don’t use a sidebar Navi system! By the way …thanks for the help you give me recently! Gbismarc!

    • Josh says:

      Hello,

      I have released version 1.7.3.1 to remedy a few problems which seemed to popup suddenly for many users. Please make sure you are updated to the newest version and see if your problem persists. Please also let me know one way or the other.

      Thanks.

Leave a Reply