Support » Theme: Spun » GUIDE: Put title inside circles with images

  • Moderator Andrew Nevins


    Forum moderator

    Current status: Working
    [Updated: 21st of December 2013]

    This thread provides instructions on how to move the title inside the image on the home page of each circle.

    Here you can see an image-based demonstration of the end result of stages 1 & 2: .

    – It will only work if a circle has an image and just for the home page;
    – It will involve creating new files and updating them, so you will need FTP access. Ask your hosting providers to help you with this.

    Stage 1

    1. First create a Child Theme using the instructions here ;
    2. Then copy “content-home.php” from your theme and paste it into your Child Theme directory;
    3. Once you have done that, edit the content-home.php file from your Child Theme directory. Replace all of its contents with the code from the either of the following PasteBin pages that suits you:
      – If you are using Spun version 1:
      – If you are using Spun version 2:
      (courtesy of hamutalwz)
    4. Afterwards edit your style.css file in your Child Theme directory.
      At the bottom of it, add the code from this PasteBin page .

    To keep the text vertically centred when there is more than one line of text and when the circles get smaller (when the browser resizes), do the following:

    Stage 2

    1. Create a new file in your Child Theme directory and name it “functions.php” ;
    2. In that functions.php file (of your Child Theme) paste this code into it: ;
    3. Create a new folder in your Child Theme directory and name it “js”;
    4. Within that “js” folder create a new file called, “text-in-circles.js”;
    5. Copy the code from this Pastebin page and paste it into your “text-in-circles.js” file.

    At the end of Stage 1 & 2 the structure of your Child Theme directory should be like this screenshot: .

    If you have any issues, please create your own thread and refer back to this thread. I’ve used stages and numbered steps to help you specify which steps you’re stuck on when you do.

    I am trying to create a unified resource for this solution, as it is a lot easier to find for you guys if it is in one place. It’s also a lot easier for me to update the solution if need be.

    (Thread closed to stop replies)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Andrew Nevins


    Forum moderator

    [Updated: 11th of August 2013]

    • Added stages to this forum post & replaced step arrows with step numbers for easier reference;
    • Added stage 2 to vertically align titles in circles if they span more than one line & if the circles get smaller;
    • Removed duplicate styles, organised styles better & added some styles to improve readability of text for Stage 1, step 4.
    Moderator Andrew Nevins


    Forum moderator

    [Updated: 21st of December 2013]

    • Changed Stage 1, step 3. to work with both versions 1 and 2 of the Spun theme.

    The explanation behind the update of Stage 1, step 3 was because there was an issue with the “content-home.php” file that was causing squared images in Spun version 2.

    Child Themes will take precedence over parent themes, but will still inherit the functionality from parent themes. In our case we inherited the changes from Spun version 2, including changes to the style.css file, but because we had a “content-home.php” file in our Child Theme that file took precedence over the updated version 2 “content-home.php” file.

    The issue was we copied over the “content-home.php” file from the Spun version 1.07 theme, but in Spun version 2.0+ the “content-home.php” file changed. There were many changes to the version 2.0+ version of this file, but the fundamental cause of the issue was because a class was added to the <img> element from within that file. That class was, “attachment-home-post”.

    In Spun version 2.0+ the styles that controlled some of the typical circular appearance and functionality that makes the circles what they are were moved to the “attachment-home-post” class.

    So, a few days ago people were having issues with square images because of the recommendations in this specific thread. To summarise, the issue was that used we an old “content-home.php” file that didn’t inherit the changes from the new Spun theme. The solution was to add the “attachment-home-post” class to the image in the “content-home.php” file for the Spun version 2 theme (see Stage 1, step 3) – and was implemented by just copying the version 2 code and modifying it slightly.

    Do let me know if you continue to have problems by creating your own thread and referring back to this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘GUIDE: Put title inside circles with images’ is closed to new replies.