With wordpress if your making a new post you can enter in html coding, but when adding links it only seems to let you enter a URL but not HTML. Im assuming this is just the way the control system is though am wondering if anyone knows what file i need to look for via ftp to be able to edit the links? Im trying to add an onclick event to one of the links in my blog. Any ideas? Paulie
This may not be what you want to hear, but when I read you post it says, to me at least, that you want javascript, listen closely, and you may hear it too, seriously, That is just one method, there are like hundreds, of way to do this, using javascript,
That doesnt answer my question and i have no clue what the code is you have just posted. As my OP says, im trying to add an onclick event to one of links, i can do ths with blog posts, but not with the links itself as they only have the option for the URL to be entered and NOT html. Anyone?
After adding a link in the regularl way, switch over to html mode in your wysiwyg editor, and add what you need to do. This will help: http://www.pageresource.com/jscript/jlinktut.htm
an onlcick event, so it would be the url followed by onclick= etc You can add html coding to posts it would seem but not to sidebar links Cheers adbox but you cant switch to html on sidebar links, ONLY on posts itself, unless im missing something
Yes you are missing something because you should be able to edit the html of links even if they are located in the sidebar. If it's a widget text box, edit the code manually, or you may have to edit the template code for the theme.
If i could find the correct file within ftp id be able to make the changes. Its just the control panel for wordpress doesnt seem to let you make html changes to the sidebar. Have tried editing the theme for sidebar, but then i dont see my links, and the onclick event is only specific to one of the links, hence trying to find the file with the sidebar links.
Paulie, you can edit the template files in the wordpress admin. Click on Apprearance and you will see that you can edit the files. If it's not a widgetized theme, it's more then likely the sidebar template file.
The problem with that is that you cant see the links when editing through the wordpress admin. So if i go to apprearance, editor, sidebar.php it wont actually contain the links in the sidebar. Seems to be the same for all files that are editable through wp admin. If i go to links>edit i can only enter the URL as it wont allow me to enter a onclick event in the URL box and in that section there seems to be no html editor for the links.
I understand the problem now! What I would do is add the blogroll links manually instead of adding the links in the admin panel, so you can edit the html. In other words, hard code the links into the template or using widgets.
Im so glad you understand my problem now Hard-coding is EXACTLY what i want to do, but im not sure how? Im not sure where id be looking in the files to find the correct file that contains the sidebar links to harcode. As for widgets, havent used them at all yet so not sure how they work. But hardcoding is def what ive been trying to do with the sidebar links, and im still going through the tons of files that is contained within wordpress (ftp) just cant find the right one that contains the links
You should see php code in the sidebar template to display the links. Replace this code with html to display the links. Alternatively, you could add the link html in a text box widget, but I would try the first option and see how you go.
Sidebar.php shows me <div id="right_bar" class="sidebar"> <ul class="sidebar_list"> <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar(2)) : ?> <li class="widget"> <h2>Search This Site</h2> <?php include (TEMPLATEPATH . '/searchform.php'); ?> </li> <li class="widget"> <h2>Categories</h2> <ul> <?php wp_list_categories('title_li=0'); ?> </ul> </li> <?php get_links_list('id'); ?> <?php endif; ?> </ul> </div> Code (markup): It doesnt have any of my links in there so i guessed it was the wrong file that actually contained the links.
<?php get_links_list('id'); ?> is what displays the blogroll links. Replace this code with the link html (look at the source code and it should be easy figuring it out).
Ok i see what your saying but isnt those links the "pages" links rather than "links" I say that as it says <?php wp_list_categories('title_li=0'); ?> If it helps, looking at source code shows me that the links are under id="linkcat-3 Not sure if that helps or not
But is there not a difference between blogroll links and the "links section"? One is linking the different categories, whilst the one i am trying to edit is under Links>Edit
which is why i suggested that you replace this code <?php get_links_list('id'); ?> if it doesn't work you can always revert back to the old code, but it should work.
It does work but loses the category, alignment etc. Would be good to know where the link list actually is but at least im getting somewhere.