Hey, first before I begin I would like to say that I have no php experience at all, a bit of html, and a bit of css. Now, my problem is that my wordpress page doesn't validate because of a plugin. It's not actually the plugin's fault.. but rather a code that extracts information from the plugin to create a section. Here is what I mean: http://bandeq.com/taiwan/ Thats the page, and on the very right hand side it shows a "Popular this month" section. Now, take a look at the validation http://validator.w3.org/check?uri=h...(detect+automatically)&doctype=Inline&group=0 Every time a post, or word, is added to the "Popular this month" section - an error is added to the validation page. Why? because it has something to do with the code generated .. the list is incorrect or something. ( I can't really explain this part well because I don't understand it fully myself, sorry if this isn't making sense ) Here is the php code that is for this section. Can anyone help me solve this problem? </li> <li> <h3 class="sidebartitle"><?php _e('Popular This Month'); ?></h3> <?php if (function_exists('get_most_viewed')): ?> <?php get_most_viewed(); ?> <?php endif; ?> </li> </ul> </div> <?php endif; ?> </div> <!--/sidebar --> PHP: Also, if anyone can help me on the other validation errors, that would be great. If you have any questions regarding my problem, just ask.. Thanks alot in advanced, Jason
Oh yeah just a notice, I'm using wp-postviews-plus.1.1.3 if that helps.. come on.. anyone help please? Jason
yes, I see what you mean... it's missing the <ul></ul> </li> <li> <h3 class="sidebartitle"><?php _e('Popular This Month'); ?></h3> <?php if (function_exists('get_most_viewed')): ?> [B]<ul>[/B] <?php get_most_viewed(); ?>[B]</ul>[/B] <?php endif; ?> </li> </ul> </div> <?php endif; ?> </div> <!--/sidebar --> Code (markup):
Yup. If you look at the output created by the get_most_viewed() function, you'll notice it creates a list with each item wrapped in a <li></li>. The function itself doesn't create an actual list, though, so you need to wrap it in <ul></ul> or <ol></ol> tags. The second error "Line 290, Column 30: required attribute "type" not specified" refers to an invalid javascript snippet. The area starts off like this... <script language="JavaScript"> var iFr; function log() { var loca=document.location+""; Code (markup): "language=" is not a valid attribute for a <script> tag anymore. Change the script tag to this... <script type="text/javascript"> ... </script> HTML: Good luck, - Walkere
Thanks both of you for your help. But what would I need to insert, and WHERE would I need to insert - so that the output creates a <ul></ul> tags? sorry, I really have no experience in this area. EDIT: oh wait, sorry I see the edited code now. Thanks so much + rep Thanks so much both of you, Jason
Hmm.. where would <script language="JavaScript"> var iFr; function log() { var loca=document.location+""; Code (markup): be located? I can't find it in any of my files. Can someone help me out with this?
Ack that's what I feared.. the footer's encrypted Is anyone able to decode this? please? <?php $_F=__FILE__;$_X='Pz48ZDR2IDRkPSJjbDJzNSI+DQogPC9kNHY+IA0KPC9kNHY+PCEtLS9wMWc1IC0tPg0KPCEtLWYyMnQ1ciBiMXIgLS0+DQo8ZDR2IDRkPSJmMjJ0NXIiPg0KPGQ0diBjbDFzcz0iMWw0Z25sNWZ0Ij48YnIvPjxici8+Jm5ic3A7Jm5ic3A7VGg1bTUgQnk6ICZuYnNwOzwxIGhyNWY9Imh0dHA6Ly93d3cubTFuMmpzcDUxa3MuYzJtIiB0NHRsNT0iUzUyIEJsMmciIHQxcmc1dD0iX2JsMW5rIj5TNTIgQmwyZzwvMT4gJm5ic3A7fCAmbmJzcDs8MSBocjVmPSJodHRwOi8vd3d3LjNzMXNwMnJ0c3RyMTRuNG5nLmMybSIgdDR0bDU9IlRyNDF0aGwybiBUcjE0bjRuZyBQcjJkM2N0cyIgdDFyZzV0PSJfYmwxbmsiPlRyNDF0aGwybiBUcjE0bjRuZyBQcjJkM2N0czwvMT4mbmJzcDt8Jm5ic3A7PDEgaHI1Zj0iaHR0cDovL3d3dy4xbHQxYmwyZy5jMm0vIiB0NHRsNT0iQmwyZyBENHI1Y3QycnkiIHQxcmc1dD0iX2JsMW5rIj5CbDJnIEQ0cjVjdDJyeTwvMT4mbmJzcDt8Jm5ic3A7PDEgaHI1Zj0iaHR0cDovL3d3dy5mcjU1LXc1Yi1oMnN0NG5nLmI0eiIgdDR0bDU9IkZyNTUgVzViIEgyc3Q0bmciIHQxcmc1dD0iX2JsMW5rIj5GcjU1IFc1YiBIMnN0NG5nPC8xPg0KPC9kNHY+DQoNCjxkNHYgY2wxc3M9IjFsNGducjRnaHQiPjxici8+PGJyLz48MSBocjVmPSI8P3BocCBibDJnNG5mMigncnNzYV8zcmwnKTsgPz4iIHQ0dGw1PSI8P3BocCBfNSgnU3luZDRjMXQ1IHRoNHMgczR0NSAzczRuZyBSU1MnKTsgPz4iPjw/cGhwIF81KCc8MWJiciB0NHRsNT0iUjUxbGx5IFM0bXBsNSBTeW5kNGMxdDQybiI+IEY1NWQgUlNTPC8xYmJyPicpOyA/PjwvMT4mbmJzcDt8Jm5ic3A7DQoJCTwxIGhyNWY9Ijw/cGhwIGJsMmc0bmYyKCdjMm1tNW50c19yc3NhXzNybCcpOyA/PiIgdDR0bDU9Ijw/cGhwIF81KCdUaDUgbDF0NXN0IGMybW01bnRzIHQyIDFsbCBwMnN0cyA0biBSU1MnKTsgPz4iPjw/cGhwIF81KCdDMm1tNW50cyA8MWJiciB0NHRsNT0iUjUxbGx5IFM0bXBsNSBTeW5kNGMxdDQybiI+UlNTPC8xYmJyPicpOyA/PjwvMT4mbmJzcDsmbmJzcDsNCiAgIDwvZDR2Pg0KPC9kNHY+DQogPCEtLWYyMnQ1ciBiMXIgNW5kIC0tPg0KPD9waHAgd3BfZjIydDVyKCk7ID8+DQo8L2IyZHk+DQo8L2h0bWw+';eval(base64_decode('JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdWllMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw=='));?> Code (markup):
Decoded: ?><div id="close"> </div> </div><!--/page --> <!--footer bar --> <div id="footer"> <div class="alignleft"><br/><br/> Theme By: <a href="http://www.manojspeaks.com" title="Seo Blog" target="_blank">Seo Blog</a> | <a href="http://www.usasportstraining.com" title="Triathlon Training Products" target="_blank">Triathlon Training Products</a> | <a href="http://www.altablog.com/" title="Blog Directory" target="_blank">Blog Directory</a> | <a href="http://www.free-web-hosting.biz" title="Free Web Hosting" target="_blank">Free Web Hosting</a> </div> <div class="alignright"><br/><br/><a href="<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><?php _e('<abbr title="Really Simple Syndication"> Feed RSS</abbr>'); ?></a> | <a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a> </div> </div> <!--footer bar end --> <?php wp_footer(); ?> </body> </html> Code (markup):
The JS in the HTML source code is right after the "footer bar end" comment, so the script would have to be from a plugin that uses wp_footer (I guess wp-postviews-plus?). You could search the plugin's PHP file in MS Word for "var iFr" or something and find it that way.
Thankyou guys so much, I will try what you've said NewQuark. Thanks stoli for decoding it I really appreciate it.
Alrighty now its validated .. but I still have some FINAL tweaks here and there - which I need you guys again! you guys are the best. First - http://bandeq.com/taiwan/ - the popular this month side bar section isn't showing the post names .. it's just showing " ... - 8 page views " as you can see. How would I make it show the post names? I think it's because of the output problem and not actually the plugin's problem .. anyways if anyone knows what the problem, please tell me how I can fix it. Second - You see after the first post on the home page, it shows "No Comments » | 8Views" Right below the post? Well how do I increase the space between the "No Comments » | 8Views" and the next post title? so instead of the No comments .. sticking right to the next post title, there would be a space between that. Where is the code that controls the spacing located? I know its in style.css .. right? I wouldn't know just a wild guess. And THIRD AND final - how do I add a RSS section right above the categories section, to the sidebar? and how do I add feedburner, etc to that section? I have attached the sidebar.php .. soo if anyone could help me out with even just one that would be so awesome .. this is probably the last tweaks I need done .. attatched is sidebar.php and wp-post plus if you need it to solve the problem. THANKS for your time, really really appreciate it.. will + rep, JASON EDIT: look at this site http://www.mediterrasiancooking.com/ I want the posts to be seperated kind of like that.
Sorry I can't help with the first issue, with the second I might. If you added "the_views('Views', true)" to your theme to make the number of views show up, try changing it to "the_views(' Views', true)" (with the space before the word "Views"). For the third, I'm not entirely sure what you're asking, do you just want links to your feed or do you want the recent feed items thing? sidebar.php seems to allow for widgets, so if you want links you can just add a text widget with the stuff you need in it. :? I feel like I'm misunderstanding.
Oh, here's the clarification. For my theme - it's wierd because it's "widgitized" for only ONE of the columns.. so I have to turn off the widgets and use the default plugins / add the sections in myself if I want anything to appear in the second column of the sidebar. Therefore that means I have to manually add in the code if I want a RSS section. I need to know what I have to do to add in the box manually ( add the code into sidebar.php ). If you know how to widgitize both sidebars, EVEN better .. For the second problem, I don't think you quite understood me either. This is whats happening right now - no spacing. This is what I want
I see, my bad. Widgetizing two sidebars is explained here (I can't do live links yet ) http://wordpress.org/support/topic/126885 (third post down, epicalex's) To add the space: .entry {margin-bottom: 20px;} Code (markup): in style.css should do what (I think) you want (20px can be changed to however many pixels you want). If you want an actual line like you drew then instead add this: .entry {border-bottom: 1px solid #cccccc; margin-bottom: 10px; padding-bottom: 10px;} Code (markup): I hope I got it this time?
awesome .. one problem is solved, but the widgitizing sidebar #2 doesn't work for me. It comes up as an error. I think it's because my functions.php is different than the one in your post. I've attatched it, because I have no idea how I would do this.. Thanks, Jason EDIT: you know what, the widgets mess it up even more ( validation errors ) I just want to add a RSS box and fix the show most post .. so can you please tell me how to edit it manually. I just want to get this part over with so I can start posting and promoting .. THANKS
yes, you need to change the code in functions.php to this: <?php if ( function_exists('register_sidebar') ) register_sidebars(2,array( 'before_bar' => '<li id="%1$s" class="bar %2$s">', 'after_bar' => '</li>', 'before_title' => '<h2 class="sidebartitle">', 'after_title' => '</h2>', )); ?> Code (markup): then each sidebar has a specific snippet of code to insert: sidebar 1: <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(1) ) : ?> Code (markup): sidebar 2 <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?> Code (markup): make sure that this bit of code is included somewhere at the end of your sidebars: <?php endif; ?> Code (markup):
If you don't want to widgetize both sidebars, then changing sidebar.php to the one I attached should add a subscribe part to the right sidebar above the recent post box (the heading will be "Subscribe," and there are two links below, one to the posts feed and one for the comments).
oh awesome - how would I place the feedburner icon and a Subscribe by email / Subscribe by RSS icon in there? would I just replace the list with the pictures and center it? Thanks alot newquark and arwen Jason
You can replace the list items with whatever you want, I'm not sure what you mean by center it (what do you want to center, and do you mean vertically or horizontally?), but if you want an icon right before the link you could just add the image in before the link (or within the link before the text or whatever). I think it's easier to center icons vertically by setting them as a background image though, if you want to do that you'd have something like this in sidebar.php (adding ID's to the links): <li> <h3 class="sidebartitle" >Subscribe</h3> <ul class="list-rec"> <li> <a id="feedrsslink" href="http://bandeq.com/taiwan/?feed=rss2" title="Feed RSS">Feed RSS</a> </li> <li> <a id="commentsrsslink" href="http://bandeq.com/taiwan/?feed=comments-rss2" title="Comments RSS">Comments RSS</a> </li> </ul> </li> HTML: and add something like this to style.css: #feedrsslink {background: #ffffff url('iconlocation.png') no-repeat scroll center left; padding-left: 20px;} #commentsrsslink {background: #ffffff url('othericonlocation.png') no-repeat scroll center left; padding-left: 20px;} Code (markup): changing the icon locations to wherever they are, and the padding depending on the size of the icons.