list all posts

<h3>Posts</h3> <ul>                 <?php while(have_posts()) : the_post(); ?> <?php foreach((get_the_category()) as $category)                           { $my_query = new WP_Query(‘category_name=’ . $category->category_nicename . ‘&orderby=title&order=asc&showposts=100’);} ?>                        <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>        <li><a href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a></li>… Read morelist all posts

Code to display visitors IP address on website

get_ip_list below is a function that you must call in order to get something. function get_ip_list() { $tmp = array(); if (isset($_SERVER[‘HTTP_X_FORWARDED_FOR’]) && strpos($_SERVER[‘HTTP_X_FORWARDED_FOR’],’,’)) { $tmp += explode(‘,’,$_SERVER[‘HTTP_X_FORWARDED_FOR’]); } elseif (isset($_SERVER[‘HTTP_X_FORWARDED_FOR’])) { $tmp[] = $_SERVER[‘HTTP_X_FORWARDED_FOR’]; } $tmp[] = $_SERVER[‘REMOTE_ADDR’]; return… Read moreCode to display visitors IP address on website

Javascript Changing Picture

Ad the following code between head: <code> <script language=JavaScript> <!– var pic_ar=new Array(); var pic_arlink=new Array(); var adNum=0; pic_ar[0]=”img/ad1.jpg”; pic_ar[1]=”img/ad2.jpg”; pic_ar[2]=”img/ad3.jpg”; pic_ar[3]=”img/ad4.jpg”; pic_ar[4]=”img/ad5.jpg”; pic_ar[5]=”img/ad6.jpg”; pic_ar[6]=”img/ad7.jpg”; pic_ar[7]=”img/ad8.jpg”; pic_ar[8]=”img/ad9.jpg”; pic_ar[9]=”img/ad10.jpg”; pic_ar[10]=”img/ad11.jpg”; pic_ar[11]=”img/ad12.jpg”; var preloadedimages=new Array(); for (i=1;i<pic_ar.length;i++){ preloadedimages[i]=new Image(); preloadedimages[i].src=pic_ar[i]; } function… Read moreJavascript Changing Picture

PHP to detect mobile phones

The most efficient way to detect mobile phones with PHP, this simply queries the accept headers, the user agent and checks for any tell tale signs that the browser we’re sniffing is a mobile device.