DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

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

Erika305

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 7
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. [attachimg=#]

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! LOL[attach=#][attach]

rgdot

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 2,197
Re: Trying To Adjust My Blog Template- Can anyone help with code?
« Reply #1 on: April 28, 2012, 06:09 PM »
This defines the four

Code: (javascript)
var contarlabels = 0;
labelname = new Array("Beauty","Gastronomy","Fashion","Lorem");
labeltitle = new Array("Beauty","Gastronomy","Fashion","Lorem");

and this cycles through

Code: (javascript)
salida += '<div class="featured">';
salida += '<h3>' + labeltitle[contarlabels] + '</h3>';
salida += salidainner;
salida += '<b><a href="http://femininamagazine-btemplates.blogspot.com/search/label/' + labelname[contarlabels] + '?max-results=10">More '+ labelname[contarlabels] +'</a></b>';
salida += '</div>';
document.write(salida);
contarlabels ++;
}

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
Re: Trying To Adjust My Blog Template- Can anyone help with code?
« Reply #2 on: April 28, 2012, 06:20 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: 2,197
Re: Trying To Adjust My Blog Template- Can anyone help with code?
« Reply #3 on: April 28, 2012, 06:36 PM »
No problem. If I can't one of the real programmers will  :D



Erika305

  • Supporting Member
  • Joined in 2012
  • **
  • Posts: 7
Re: Trying To Adjust My Blog Template- Can anyone help with code?
« Reply #4 on: April 28, 2012, 06:42 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: 2,197
Re: Trying To Adjust My Blog Template- Can anyone help with code?
« Reply #5 on: April 28, 2012, 07:26 PM »
No, that's there. It reads through the array of the first.

Original address: https://www.donationcoder.com/forum/index.php?topic=30839.0