Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 05, 2015, 12:48:47 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Trying To Adjust My Blog Template- Can anyone help with code?  (Read 1410 times)

Erika305

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 7
    • View Profile
    • Donate to Member
Hi!

I am trying to adjust my blog template.

I was up for HOURS trying to see if I could figure out how to tweak this code to allow for 14 categories(labels) for this blog template but I couldn't do it. You know how you label each post to categorize it.

If you look at this template, in the picture you'll see how it is soo awesome and lists the content by category with the latest posts automatically generating at the top for each category (label). Its awesome and it works but it only allows for 4 categories and I need 14-16 to showcase all different types of content. [ Invalid Attachment ]

Do you have any suggestions for how to duplicate this code to make it what I need? I attached the Template with the XML extension as well as a JPEG of the way the template looks when loaded. You will find the "array" is the name of each category in the html code part. Some of it may be in Portugese because that is where the coder is from.


Haha! I feel so smart talking HTML with you! LOLFeminina Template Pic.jpg

rgdot

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 1,801
    • View Profile
    • Donate to Member
Re: Trying To Adjust My Blog Template- Can anyone help with code?
« Reply #1 on: April 28, 2012, 01:09:15 PM »
This defines the four

Code: Javascript
  1. var contarlabels = 0;
  2. labelname = new Array("Beauty","Gastronomy","Fashion","Lorem");
  3. labeltitle = new Array("Beauty","Gastronomy","Fashion","Lorem");
  4.  

and this cycles through

Code: Javascript
  1. salida += '<div class="featured">';
  2. salida += '<h3>' + labeltitle[contarlabels] + '</h3>';
  3. salida += salidainner;
  4. salida += '<b><a href="http://femininamagazine-btemplates.blogspot.com/search/label/' + labelname[contarlabels] + '?max-results=10">More '+ labelname[contarlabels] +'</a></b>';
  5. salida += '</div>';
  6. document.write(salida);
  7. contarlabels ++;
  8. }
  9.  

The array has 4 values. Other categories names can be added to the array.

I am NOT a programmer but have some idea...

Erika305

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 7
    • View Profile
    • Donate to Member
Re: Trying To Adjust My Blog Template- Can anyone help with code?
« Reply #2 on: April 28, 2012, 01:20:24 PM »
Thanks. I tried to just- add more labels- but when I loaded the template it only displayed the last four labels.

I am not sure how you are suggesting with the 2nd pic you included, that I can change the number of arrays. How do I do that?

But thanks so much for even looking at it for me!

rgdot

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 1,801
    • View Profile
    • Donate to Member
Re: Trying To Adjust My Blog Template- Can anyone help with code?
« Reply #3 on: April 28, 2012, 01:36:33 PM »
No problem. If I can't one of the real programmers will  :D




Erika305

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 7
    • View Profile
    • Donate to Member
Re: Trying To Adjust My Blog Template- Can anyone help with code?
« Reply #4 on: April 28, 2012, 01:42:30 PM »
Are you saying that the 2nd code you posted is the adjustment I need to create more arrays?

rgdot

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 1,801
    • View Profile
    • Donate to Member
Re: Trying To Adjust My Blog Template- Can anyone help with code?
« Reply #5 on: April 28, 2012, 02:26:23 PM »
No, that's there. It reads through the array of the first.