Jump to content


Photo

The Main Logo - Cant change the Alt tag


  • Please log in to reply
14 replies to this topic

#1 bizint

bizint

    Advocate

  • Members
  • 395 posts
  • Country: Country Flag

Posted 17 January 2012 - 12:43 AM

When I upload my logo I change the alt tag but it just seems to be my site title on hober... for seo I dont wnat my site title on every the alt tag I want my 3 main keywords, but I cant change the alt tag....any ideas?

#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 17 January 2012 - 04:33 AM

Just to clarify: For your site title, you want your alt tag to be the 3 main keywords and when you try to change it to the 3 keywords, it doesn't work?

#3 arpowers

arpowers

    Founder

  • Administrators
  • 3271 posts
  • LocationSan Francisco, CA
  • Framework Version:2.3
  • Country: Country Flag

Posted 17 January 2012 - 06:01 AM

How would you like this to work ideally? Currently you can use a filter to change anything you want about your site logo, but it requires a little bit o' code...

#4 bizint

bizint

    Advocate

  • Members
  • 395 posts
  • Country: Country Flag

Posted 17 January 2012 - 11:16 PM

The main logo is seen on every page -so my seo guy wants to change the alt tags of this particular image to include the keywords we're chasing. But this particular image seems to default to the blog title I think (in my case Business Interiors).... ideally I'd like to be able to change the alt tag of this image like I can do for any image on the site - but for some reason it is locked out of the editing system system. I even have "SEO friendly images" plug in that takes the title of the image and creates an alt tag from the file name. The image is also impervious to this plug in.... So anyway to change the alt tag title etc.. of this main logo image would be a useful addition. Many thanks.

#5 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 17 January 2012 - 11:48 PM

If you look in library.templates.php around line 323 you can see the function that outputs the logo. You can add a filter to platformbase/functions.php to change this output.

#6 bizint

bizint

    Advocate

  • Members
  • 395 posts
  • Country: Country Flag

Posted 19 January 2012 - 12:52 AM

Mmm looked in the library php...I couldnt see anything around line 323...is there some code I can search to pinpoint? I just want to change the alt tage from "Business Interiors" to " Office Design, Office refurbishment & Office Fit Out UK from Business Interiors"....hope its easy!

#7 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 19 January 2012 - 03:20 AM

The code you're looking for should look like this:

 function pagelines_main_logo(){
		if(pagelines_option('pagelines_custom_logo')){
	
			$site_logo = sprintf( '<a class="mainlogo-link" href="%s" title="%s"><img class="mainlogo-img" src="%s" alt="%s" /></a>', home_url(), get_bloginfo('name'), esc_url(pagelines_option('pagelines_custom_logo')), get_bloginfo('name'));


#8 bizint

bizint

    Advocate

  • Members
  • 395 posts
  • Country: Country Flag

Posted 21 January 2012 - 11:48 AM

Ah ha! I was looking in library.functions.php not library. templates.php - searched on your code and found it! So I changed the code to read this (just changing the alt tag): function pagelines_main_logo(){ if(pagelines_option('pagelines_custom_logo')){ $site_logo = sprintf( 'office design - office refurbishment london - office fit out birmingham - business interiors', home_url(), get_bloginfo('name'), esc_url(pagelines_option('pagelines_custom_logo')), get_bloginfo('name')); echo apply_filters('pagelines_site_logo', $site_logo); } else { $site_title = sprintf( '
%s
%s
', esc_url(home_url()), __('Home','pagelines'), get_bloginfo('name'), get_bloginfo('description')); echo apply_filters('pagelines_site_title', $site_title); But guess what - nothing changes!!!! I'm putting the new library.templates.php file in platformbase>sections area as advised. Any changed php file I put in the child base theme DOES NOT WORK....I've tried changing the carousel PHP and nothing happened when I wanted a lopp on carousel...I must be doing some thing wrong. Please can someone tell me what is going wrong. Shall I just makes these changes directly in platformpro and be done with it? But that defeats the object of having a child theme. I'm now slamming my head on the table - repeatedly...surely this should be so simple...slam slam SLAM! Actually - I dont know how putting a php file in the sections area of platform base mysteriously overides the one in platform pro anyway...I'm just going on what you guys tell me, making the changes and putting it in there. Now going for a walk on a big hill and will have a bloody good scream from the top of it! ;-)

#9 bizint

bizint

    Advocate

  • Members
  • 395 posts
  • Country: Country Flag

Posted 21 January 2012 - 11:52 AM

I've just looked at Castelic's "functions.php: post.... Let me be clear how I'm doing this...I'm taking the entire library.template.php file....making the changes...then putting it into the directory platformbase>sections> - so in the sections folder of platformbase - I havent amended any platformbase/functions.php file...what's that all about?

#10 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 21 January 2012 - 05:09 PM

The filter that you need to create that makes the logo modification needs to be added to the functions.php file.

#11 bizint

bizint

    Advocate

  • Members
  • 395 posts
  • Country: Country Flag

Posted 21 January 2012 - 10:54 PM

Ok...this sounds encouraging...what is this filter? This is a new one...thats why its never worked I guess...I thought we just changed the php file we wanted to change put put it in platform base...but changing the functions.php? Errr I change php...what do I do to it? In platformpro or base?

#12 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 22 January 2012 - 01:40 AM

Hi,

FTP into your site and navigate to wp-content/themes/platformbase/functions.php and open that file in a text editor.

Locate this line:
 // Once overridden you can copy the code from that section, paste it there and edit to your heart's content.

Right below it, add this:
 add_filter('pagelines_site_logo', 'my_header');
	
	function my_header($header) {
	  $header = sprintf('<a class="mainlogo-link" href="%s" title="%s"><img class="mainlogo-img" src="%s" alt="office design, office refurbishment london, office fit out, birmingham, business interiors" /></a>', 'http://www.YOURWEBSITEURL.com/', get_bloginfo('name'), esc_url(pagelines_option('pagelines_custom_logo')), get_bloginfo('name'));
	  return $header;
	}

This will place your SEO friendly text as an ALT to each page. Replace YOURWEBSITEURL.com. This ensures that the URL appears on every page and that your branding will always link to your homepage.

Save the file and upload. That's it. All you need to do. And please do not use punctuation marks in the alternative text. In case your SEO specialist hasn't mentioned it, dashes bridge keywords where commas separate them. A search engine seeing dashes would make the alt text an expression and unless someone typed the whole string, they would not find you. Using commas will ensure that each word gets higher placement. However, if you wish, just replace the original posted above.

Without criticizing this specialist, I would like to point out that my site's traffic volume in Dec 2010 was somewhere around 530,000 pageviews a month. In April, after converting to Platform Pro, with no SEO effort, but using keywords and excerpts as well as adding new content each week, the site rose and now we're doing so much traffic the site is crashing. December 2011 saw 2.4 Million pageviews, a 400%+ increase. I also didn't have to pay a specialist. ;-)

#13 bizint

bizint

    Advocate

  • Members
  • 395 posts
  • Country: Country Flag

Posted 22 January 2012 - 07:27 PM

That worked! *dances around the room, punches air, dog concerned at madness*. So happy thanks...I was starting to think PHP had it in for me. Incredible page views - well done on your site, I can only dream of that. We max at 200 a day! But we're doing new articles and working full time about getting it perfect. I employed a SEO guy to check what I/we had done - its all new to us and we're doing it in house (not our day job!) - I'm not sure he was good value, but its nice to know the foundations are right I think. I had a similar query for looping carousel...perhaps you could take a look and tell me if I need a filter there too!