Support » Themes and Templates » [Resolved] Website Logo Words color

[Resolved] Website Logo Words color

  • I know I ask too many questions but I just really like your theme and I am not a coder and I don’t want to mess things up. Is there anyway that JUST FOR THE LOGO of the site that I can make the first 2 letters one color and the rest the other color? Because right now my logo splits colors in a position I do not want it. The rest of the site splits between colors perfectly, but because my site name is kind of weird, I want only the firsst 2 letters of it to be black and the rest blue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • If you’re not a coder, and you plan on designing more web sites, you should pick up some skills. w3schools.com has some excellent tutorials.

    Anyway, here is a JavaScript solution for you. Go to Appearances > Montezuma Options > Head > Insert code and copy & paste this code into the Bottom field. This will leave the first two letters black and the rest of your site title blue:

      // This code changes the firstpart of #sitetitle to cover just the first two characters
    	// Get HTML of site title. This includes the link, but more importantly,
    	// it includes the span which marks the "firstpart".
    	var strSiteTitleHtml = $("#sitetitle").html();
    	// Get the text in the first part of the site title
    	// so we can search for it later within the HTML string
    	var strFirstPart = $("#sitetitle .firstpart").text();
    	// Find the position of the ending span tag within the HTML
    	var iEndSpan = strSiteTitleHtml.indexOf("</span>");
    	// Remove the ending span tag from the HTML string by concatenating
    	// the part before the tag with the part after the tag (note that </span>
    	// is 7 characters long).
    	strSiteTitleHtml = strSiteTitleHtml.substr(0, iEndSpan)
    		+ strSiteTitleHtml.substr(iEndSpan + 7);
    	// Find the position of the first part of the site title
    	// within the new HTML string
    	var iSiteTitle = strSiteTitleHtml.indexOf(strFirstPart);
    	// Insert the end span tag after the second character of the site title
    	strSiteTitleHtml = strSiteTitleHtml.substr(0, iSiteTitle + 2)
    		+ "</span>"
    		+ strSiteTitleHtml.substr(iSiteTitle + 2);
      	// Finally, set the HTML of the site title to the modified HTML string
    });   // End of the ready function

    I see from another post that I already had you copy some code into the Bottom field. What you can do for this, then, is just copy & paste the indented lines from above (starting with the line after the JQuery line and up to, but not including, the next-to-last line that says End of the ready function) and paste that into your existing ready function.

    This worked perfectly. Thank you so much once again

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Website Logo Words color’ is closed to new replies.