The company I work for has a division with a different logo. Is there anyway to make it display a different logo on one page only?
Different logo on one page
(30 posts) (2 voices)-
Posted 1 year ago #
-
Hi,
do you know some PHP?
regards,
MichaelPosted 1 year ago # -
No, I don't. Any help would be wonderful.
Posted 1 year ago # -
Give me the ID of that page, and I'll try to prepare some code :)
regards,
MichaelPosted 1 year ago # -
Is that the order number ID? If so 12
Posted 1 year ago # -
Posted 1 year ago #
-
ID 95 for the page I am looking to have the different logo. Thanks
Posted 1 year ago # -
OK, give me some time to prepare it
regards,
MichaelPosted 1 year ago # -
Just checking in on this! Had a chance to look at it yet?
Posted 1 year ago # -
yup, please send me an email, nad I will respond :)
regards,
MichaelPosted 1 year ago # -
Okay sent you an email through themeforest, as I can't find your actual email address.
Posted 1 year ago # -
OK, thank you
Posted 1 year ago # -
Hey, still haven't heard anymore on this? Can you let me know what's up with it.
Thanks!
Posted 1 year ago # -
Hi,
please check your spambox
regards,
MichaelPosted 1 year ago # -
Hey Michael,
Nope I don't see anything. When did you send it? Can you try again please? Thanks!
Posted 1 year ago # -
OK
Posted 1 year ago # -
My email is seanmconroy {at} gmail . com
I am assuming you haven't sent it again, haven't seen anything come through. Thanks.
Posted 1 year ago # -
Mayne my antivirus is blocking php files:/ I'll try to send you a direct code
regards,
MichaelPosted 1 year ago # -
Could you create a zip file and then use one of those send file services such as sendspace, I really need to get this ASAP. Just post the to it in here or something.
Thanks again.
Posted 1 year ago # -
1) Open "flare-child-theme/functions.php" file
2)
function btp_site_id_capture() {
$out = '';/* Get all required data */
$name = get_bloginfo( 'name' );
$description = get_bloginfo( 'description' );
$src = btp_theme_get_option_value('general_logo_src');/*Here's your modification*/
if ( is_page(95)) {
$src = 'path_to_another_logo.png';
}$out .= '<div id="id">';
if ( is_front_page() ) {
$out .= '<h1 class="site-title">';
$out .= '';
if ( strlen( $src) ) {
$out .= '<img src="' . esc_url( $src ) . '" alt="' . esc_attr( $name ) . '" />';
} else {
$out .= esc_html( $name );
}
$out .= '';
$out .= '</h1>';
} else {
$out .= '<p class="site-title">';
$out .= '';
if ( strlen( $src) ) {
$out .= '<img src="' . esc_url( $src ) . '" alt="' . esc_attr( $name ) . '" />';
} else {
$out .= esc_html( $name );
}
$out .= '';
$out .= '</p>';
}/* Capture tagline */
if ( 'none' !== btp_theme_get_option_value( 'style_header_tagline' ) && strlen( $description ) ) {
if ( is_front_page() ) {
$out .= '<p class="site-tagline">' . esc_html( $description ) . '</p>';
} else {
$out .= '<p class="site-tagline">' . esc_html( $description ) . '</p>';
}
}
$out .= '</div><!-- #id -->';return $out;
}
Posted 1 year ago # -
Plce this function inside this file :)
regards,
MichaelPosted 1 year ago # -
HELP! I tried to add this and now my whole site will not load, error message. Can you provide the exact way it should be copy and pasted in the file.
Fatal error: Cannot redeclare btp_site_id_capture() (previously declared in /nfs/c09/h03/mnt/137428/domains/fourquest.com/html/fourquest/wp-content/themes/flare/lib/functions.php:1409) in /nfs/c09/h03/mnt/137428/domains/fourquest.com/html/fourquest/wp-content/themes/flare-child-theme/functions.php on line 20
I can't seem to do anything to get the site to work...
Posted 12 months ago # -
Okay I got the site back by downloading the functions file and getting rid of the code. But if you can provide exactly where it goes in the functions file that'd be great as something obviously isn't right.
Posted 12 months ago # -
As well everytime I save a page or anything in the editor I get errors like this,
Warning: Cannot modify header information - headers already sent by (output started at /nfs/c09/h03/mnt/137428/domains/fourquest.com/html/fourquest/wp-content/themes/flare-child-theme/functions.php:24) in /nfs/c09/h03/mnt/137428/domains/fourquest.com/html/fourquest/wp-includes/pluggable.php on line 866
But the changes happen.
Posted 12 months ago # -
Okay I was able to fix this error! There was a blank space after the end PHP, apparently a no-no.
But if you can still provide the code with the code that's already in the functions file, that would help a lot to avoid error on my end.
Posted 12 months ago # -
Hi,
where exactly did you put this function?
Because the function inside the parent theme is wrapped with something like this:
if ( ! function_exists( 'btp_site_id_capture' ) ) :regards,
MichaelPosted 12 months ago # -
Here's what I did...
<?php
/* Prevent direct script access */
if ( !empty( $_SERVER[ 'SCRIPT_FILENAME' ] ) && 'functions.php' == basename( $_SERVER['SCRIPT_FILENAME'] ) ) {
die ( 'No direct script access allowed' );
}/**
* Flare Child Theme Setup
*
* Always use child theme if you want to make some custom modifications.
* This way theme updates will be a lot easier.
*/
function btp_flarechild_setup() {function btp_site_id_capture() {
$out = '';/* Get all required data */
$name = get_bloginfo( 'name' );
$description = get_bloginfo( 'description' );
$src = btp_theme_get_option_value('general_logo_src');/*Here's your modification*/
if ( is_page(95)) {
$src = 'http://www.fourquest.com/fourquest/wp-content/uploads/fourquest-techresource-logo.png';
}$out .= '<div id="id">';
if ( is_front_page() ) {
$out .= '<h1 class="site-title">';
$out .= '';
if ( strlen( $src) ) {
$out .= '<img src="' . esc_url( $src ) . '" alt="' . esc_attr( $name ) . '" />';
} else {
$out .= esc_html( $name );
}
$out .= '';
$out .= '</h1>';
} else {
$out .= '<p class="site-title">';
$out .= '';
if ( strlen( $src) ) {
$out .= '<img src="' . esc_url( $src ) . '" alt="' . esc_attr( $name ) . '" />';
} else {
$out .= esc_html( $name );
}
$out .= '';
$out .= '</p>';
}/* Capture tagline */
if ( 'none' !== btp_theme_get_option_value( 'style_header_tagline' ) && strlen( $description ) ) {
if ( is_front_page() ) {
$out .= '<p class="site-tagline">' . esc_html( $description ) . '</p>';
} else {
$out .= '<p class="site-tagline">' . esc_html( $description ) . '</p>';
}
}
$out .= '</div><!-- #id -->';return $out;
}
}
add_action( 'after_setup_theme', 'btp_flarechild_setup' );
?>Posted 12 months ago # -
Oh, so you've got one function declaration inside another: btp_site_id_capture inside function btp_flarechild_setup and that causes error.
Please place btp_site_id_capture function directly before the closing PHP tag at the end of a file, and it should work then
regards,
MichaelPosted 12 months ago # -
Woo hoo! Success! Thanks!
Posted 12 months ago # -
np :)
Posted 12 months ago #
Reply
You must log in to post.