Problem with putting a code into my functions php ?
-
This is what I Want :
<?php
/**
* Modify the footer copyright text
*/
function at_register_sidebars() {
$max_columns = 3; // change to number of columns you want to add to your footer
$text_domain = 'appthemes'; // the text domain to use for translating the strings
foreach ( range(1, $max_columns) as $number ) {
$sidebar_name = sprintf(__('Footer Column %d', $text_domain), $number );
register_sidebar( array(
'name' => $sidebar_name,
'description' => '',
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
'after_title' => '</h2>',
) );
}
}
add_action( 'wp_loaded', 'at_register_sidebars' );
/**
* Add custom classes for easier styling
*/
function my_body_class( $classes ) {
if ( is_singular() && ! have_comments() ) $classes[] = 'nocomment';
return $classes;
}
add_filter( 'body_class', 'my_body_class' );
/**
* Changes text of blog archive title bar on blog archive main page from category archive name to what you like
*/
function graphene_filter_gettext( $translated, $original, $domain ) {
$strings = array(
'Category Archive: <span>%s</span>' => 'Latest Articles from '<em><span>%s</span></em>' ',
);
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 );
/**
* Removes permalink box with info from appearing on hover on top of post titles
*/
function graphene_filter_gettext( $translated, $original, $domain ) {
$strings = array(
'Permalink to %s' => ' ',
);
if ( ! empty( $strings[$original] ) && is_front_page() ) {
$translations = &get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}
return $translated;
}
add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );This is the part that I am putting in that is causing an issue :
/**
* Removes permalink box with info from appearing on hover on top of post titles
*/
function graphene_filter_gettext( $translated, $original, $domain ) {
$strings = array(
'Permalink to %s' => ' ',
);
if ( ! empty( $strings[$original] ) && is_front_page() ) {
$translations = &get_translations_for_domain( $domain );
$translated = $translations->translate( $strings[$original] );
}
return $translated;
}
add_filter( 'gettext', 'graphene_filter_gettext', 10, 3 );I get this error : Fatal error: Cannot redeclare graphene_filter_gettext() (previously declared
Any way I can make this work ? Thank you
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.