Modifying a theme, need some (code)expert help please

by 7 replies
9
Hi guys,

I am in the process of changing my theme. I have found a very simple nice looking theme that I really like. But I need to modify it, some of those changes can be made with plug ins, but I like the hands on approach where I can change the codes and learn as I go instead of adding a new plug-in every time I need to modify something. Plus, I have heard that too many plug-ins might slow down the load time.

Anyway, I am not very technical, so I need some help to make sure I am doing it right. I have been spending the past 2 days trying to figure things out and change things one by one. I just need those of you who know about theme and coding to look at these codes and see if there is anything wrong with them. I would really appreciate your help.


By the way the theme I am trying to modify is Thechnoholic.


The bottom footer has 3 section whcih were originally (left) Recent Entries (center) Archive (right) Meta

But I wanted to change it to (left) Recent Comments (center) Blogroll (right) other (links like contact me, privacy policy and etc)




Original Bottom Menu Center code:

<div id="bottommenu_center" class="menu">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('bottommenu_center') ) : ?>
<h3><?php _e('Archives','sh');?></h3>
<ul>
<?php wp_get_archives('type=monthly'); ?>
</ul>
<?php endif; ?>
</div>


Changed to:

<div id="bottommenu_center" class="menu">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('bottommenu_center') ) : ?>
<h3><?php _e('Blogroll','sh');?></h3>
<ul>
<li><a title="link1" href="http://www.linknumber1.com" target="_blank">link1</a></li>
<li><a title="link2" href="http://www.linknumber2.com" target="_blank">link2</a></li>
</ul>
<?php endif; ?>
</div>





Original Bottom Menu Right code:


<div id="bottommenu_right" class="menu">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('bottommenu_right') ) : ?>
<h3><?php _e('Meta','sh');?></h3>
<ul>
<li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
<li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>

</ul>

<?php endif; ?>
</div>




Changed to:

<div id="bottommenu_right" class="menu">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('bottommenu_right') ) : ?>
<h3><?php _e('other','sh');?></h3>
<ul>

<li><a title="SiteMap" href="http://www.blogstash.com/sitemap/" target="_self">SiteMap</a></li>
<li><a title="Contact " href="http://www.blogstash.com/contact-me/" target="_self">Contact Me</a></li>


</ul>



Are all the codes right? I am kind of worried about the last parts of them (colored in green), I know it should be changed, but I don't know to what and how?




Original Bottom Menu Left code:
(This one I am having trouble changing it)

<div id="bottommenu_left" class="menu">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('bottommenu_left') ) : ?>
<h3><?php _e('Recent Entries','sh');?></h3>
<ul>
<?php wp_get_archives('type=postbypost&limit=8'); ?>
</ul>
<?php endif; ?>
</div>


I need this to be "Recent comment" instead of "Recent Entries". However, when I change the wp_get_archives to wp_get_comment, the whole bottom footer disappears. Isn't that the right code for calling comments?... How can I do this?


Thank you very much In advance. I am sorry, I know its a lot of codes.
#website design #codeexpert #modifying #theme
  • You might get a quicker answer if you post this in the programming sub-forum. I understand that it is related to webdesign, but actually its php coding, and not all web designers do php coding.

    There are many people in the prpgramming forum that may be kind enough to help you?

    All the best,
    Steve
    • [ 1 ] Thanks
  • No, it is absolutely NOT programming. Just because you see 2 lines of code... it doesn't mean it is programming

    Problems with your code:

    Bottom Right - leave the wp_meta as it is: it is a hook.
    CLOSE the "php if..." - always be careful with his.

    Whenever you have an opening for "if statement", like:
    <?php if ...code-here... ?>
    try to find and keep the CLOSING (=ending) tag for it:
    <?php endif; ?> <== it's pretty much self-explanatory



    btw, you just killed the possibility to add widgets there.

    You can't do that!
    The snippet you removed is a "template tag" (see the Codex) = code lines defined by the WP developers to call functions from the WP engine. You can NOT change them arbitrarily to whatever you fancy

    Advice: If you want to learn theme editing...
    1. always have the Codex open in another window
    2. Have a local (XAMPP) installation of WP so that you can edit any template file "live"


    EDIT. To Steve. Basic forum etiquette: for a one-liner you don't need to quote the whole previous post.
    • [ 1 ] Thanks
    • [2] replies
    • LOL! I understand that..... Sorry for the wrong symantics. It scripting or coding. Not programming. But the programming section is where I have found most of the people who are sharp with php.

      Either way, most webdesigners do not know php coding. Specifically wordpress coding. At least not from my experience, unless they are trained in it or trained themselves.
      • [1] reply
    • Thank you very much to all of you guys for taking time to help.


      Oh, sorry, I had actually left that the way it was, I just didn't paste it here. Either way, thanks for mentioning it, because I really had no idea why I left it there, lol!

      So, is <?php if ..?> for placing widgets? Meaning anywhere you see it, that will be it?


      So, is my only (easy that I can do) option to use a widget there?


      Thanks. I tried XAMPP, but I couldn't get far. Now I installed a plugin called "theme test drive" which lets me work on other themes, but normal visitors see the original theme. Its very helpful for me.

      Istvan, To be honest, I was hoping you were around. Thank you very much for helping every time I post a question here. I see your ads for wp videos and others, but do you offer any paid services for quick fix ups? Like changing a few things and taking a look at the whole thing to make sure its all validated?...

      Either way, thank you very much. I really appreciate it.


      Thank you very much again guys.
  • He was also missing the closing div after the missing <?php endif; ?>
    On the bottom right.
    • [ 1 ] Thanks

Next Topics on Trending Feed

  • 9

    Hi guys, I am in the process of changing my theme. I have found a very simple nice looking theme that I really like. But I need to modify it, some of those changes can be made with plug ins, but I like the hands on approach where I can change the codes and learn as I go instead of adding a new plug-in every time I need to modify something. Plus, I have heard that too many plug-ins might slow down the load time.