Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #16155

    The website I’m working on has 5 slightly different logos, one for each activity of the association.

    I would like to put a different logo in the top-left corner of every page, instead of having the same logo in all pages as in the standard theme-options. Do is there a way to do it?

    Also, how to change the small “flash” icon under every post?

    Thanks

    F.

    #90376

    Hi,

    This is a bit involved, I thought I could write it out quickly, but with the instructions, I would have to finish it when my shift ends. I hope you are comfortable editing php.. well it’s copy/paste mostly.

    Thanks,

    Nick

    #90377

    Hi,

    Here is the initial part., I just have to add the code as I wrote above, but you can do the preliminary part, to set everything up:

    Hi,

    1) You can do it if you know php, and are comfortable editing source files, its actually not that difficult. You basically have 1 ‘main’ logo which covers all pages except for 4 pageID numbers, each page representing the 4 pages with distinct logos.

    2) The logos themselves you just upload into the media section in the back-end and note down the url of each logo. Then you create the 5 pages and save them. One you will simply ignore since it will take the logo you add in the back-end normally.

    3) But the other 4 you need to note down the ID numbers. The way you do that is by clicking Edit Page, and then look at the url in your browser, it should look something like http://your-website.com/wp-admin/post.php?post=5&action=edit.

    4) Now you notice that post=5? That’s the ID number and you jot it down for each of the 4 pages, and write it down next to the URL of the logo you want to go on that specific page (remember that you uploaded each in the previous step.)

    5) Next You will need to open up one of the theme files with notepad, located in directory /framework/php/ and the file there is called function-set-avia-frontend.php. First , please make a backup of the file in case anything happens, you will be able to rename it back.

    6) Once you have the file in step 5 opened, you need to look for a block of code that looks just like the one below that should be between lines 382-407:Once you’ve found it, select it all, and when you are ensured that you selected it all (no more and no less) , please delete the entire block. from line 382-407. And for now put QQQQ in its place, just so that you wont forget its former location.

    Code for only step 6 is below:

    if(!function_exists('avia_logo'))
    {
    /**
    * return the logo of the theme. if a logo was uploaded and set at the backend options panel display it
    * otherwise display the logo file linked in the css file for the .bg-logo class
    * @return string the logo + url
    */
    function avia_logo($use_image = "")
    {
    $use_image = apply_filters('avia_logo_filter', $use_image);

    if($logo = avia_get_option('logo'))
    {
    $logo = "<img src=".$logo." alt='' />";
    $logo = "<h1 class='logo'><a href='".home_url('/')."'>".$logo."</a></h1>";
    }
    else
    {
    $logo = get_bloginfo('name');
    if($use_image) $logo = "<img src=".$use_image." alt='' title='$logo'/>";
    $logo = "<h1 class='logo bg-logo'><a href='".home_url('/')."'>".$logo."</a></h1>";
    }

    return $logo;
    }
    }

    7a) Now you will need to copy the block of code *below* and paste it into an empty open notepad.

    // Missing Part that I will provide later on today.

    7b) I did all the legwork but you still must edit the code above that you now saved in notepad in order to replace placeholder ***URL-LOGO-1*** with the url of one of the four logos, (url must start with http:// , and must end with .jpg, or .png or .gif) You will need to also replace placeholder ***ID-LOGO-1*** with the corresponding id of the page that you want to apply the logo to.

    8) Replace the URL-LOGO based on the number behind it (1-4) as well as four ID-LOGO. When you are done, copy the code you’ve just edited and paste it where in step 6 above you wrote QQQQ (delete the QQQQ prior to pasting.).

    9) See if everything works. (replace the file on the server with the one you just edited. If there is a crash. simply rename the edited file to .bak and add the original.

    10) Please read the three points below, and I wish you good luck and please let us know how it went.

    *Please be aware that:

    (a) The only way this code will work is if there is a logo installed automatically (the 5th logo) in regular theme options. If for some reason that main logo gets removed, all other logos get removed automatically, and the website will default to the website name in text instead of the logo

    (b) All four pages must be of type ‘Page’ (not Post and not Portfolio Item, or anything else except Page) .

    (c) If you update the theme, this customization will disappear and you will have to redo this entire procedure. Updating WordPress itself, or any plugin will *not* delete this customization, only updating the Flashlight Theme can do that.

    Thanks,

    Nick

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Logo changing in every page, possible?’ is closed to new replies.