Since WordPress is php based, in order to use shortcodes on the sidebar or anywhere on the theme, we have to use echo.
<h2><?php echo do_shortcode(‘ catlist categorypage=yes excerpt=yes excerpt_size =255)]’); ?></h2>
This is the shortcodes for catlist to list related posts in the same category on the sidebar for my single.php that I’m designing right now (the right bracket before ‘catlist’ is missing).
- Create Login-Logout Button For WordPressCreate buttons login/logout using “cooltext.com”, put in a root folder and place the codes on a template of the theme, in my case it’s sidebar.php and I want the buttons to show up at the beginning, center of the right side column. <div id=”side-right”> <p style=”text-align:center;”><?php if (is_user_logged_in()) : ?><a href=”<?php echo wp_logout_url(“<?php echo bloginfo(‘url’); ?>” ); ?> “><img src=”/logout.png” onmouseover=”this.src=’/logouth.png’;” onmouseout=”this.src=’/logout.png’;” /></a> <?php else : ?><a alt=”Login/Register” href=”<?php echo bloginfo(‘url’); ?>/wp-login.php”><img src=”/login.png” onmouseover=”this.src=’/loginh.png’;” onmouseout=”this.src=’/login.png’;” /></a> <?php endif;?></p> <?php dynamic_sidebar(‘right’); ?> </div>
- Supersized Full Screen SlideshowSupersized Full Screen Slideshow This is a very good tool for displaying full screen images. dpl3 for jalbum
- Customize Login Page In WordPressI wanted to change the login page background with my own blog logo. By searching the user forum, someone did it in a way that even with the new update, the blog logo will always be there, just the background will change. I copied his codes and put in the theme function.php on the first line and it works. Here is the code with the techs11.png logo I created and put in the images folder of my theme. add_action(“login_head”, “my_login_head”); function my_login_head() { echo ” <style> body.login #login h1 a { background: url(‘”.get_bloginfo(‘template_url’).”/images/techs11.png’) no-repeat scroll center top transparent; height: 64px; width: 300px; } </style> “; } I modified the wp-admin.css, replaced the background of login to my images and here is how it came out. Modify wp-admin/css/wp-admin.css body.login{background:url(/techs/wp-content/themes/idogwp/images/3e0000.gif);min-width:0;}… .login form{margin-left:8px;padding:26px 24px 46px;font-weight:normal;background:url(/techs/wp-content/themes/idogwp/images/back2.png) no-repeat top left;} Remove all borders and css3 for login form. Next, create the blog logo size 300×64 pixels with transparent background (use free program paint.net is best for this logo) and put it in the theme’s images folder. Save as png to keep the transparent background.
- Add Floating Icons On WordPress BlogI like floating Icons on the side page, move up/down with the scroll, cool. There are tons of tutorial about this, I just wrote this up to remind me how to do mine. Add these lines in our theme style.css. /*side column*/ #return_top a { position:absolute; position:fixed; left:0; bottom:15px; display:block; height:138px; width:38px; background:url(images/return-top.png) no-repeat left top; }/* retun-top.png is in the images folder*/ #return_top a:hover { background:url(images/return-top.png) no-repeat right top; text-decoration:none; } #fixed_icons { background: transparent; padding:5px 5px 5px 2px; width: 36px; /*the width of the icon images*/ position: fixed; bottom: 25%; /*this position from the bottom of the page up*/ left: 0.20%; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; } #fixed_icons a { display: block; text-indent: 24px; height: 32px; /*height of icon max*/ padding-bottom:3px; text-decoration: none; } #fixed_icons #twitter { background: url(“images/icons/twitter_32.png”) no-repeat; } #fixed_icons #facebook { background: url(“images/icons/facebook_32.png”) no-repeat; }/*theme icon images*/ #fixed_icons #linkedin { background: url(“images/icons/myspace_32.png”) no-repeat; } #fixed_icons #rss { background: url(“images/icons/rss_32.png”) no-repeat; } /*end sidecolumn*/ And these lines in the footer.php <div id=”fixed_icons”> <a href=”//www.facebook.com/sharer.php?u=<?php the_title(); ?><?php the_permalink(); ?>” id=”facebook” title=”Share On Facebook” target=”_blank”></a> /*this icon is from theme*/ <g:plusone annotation=”none”></g:plusone> /*this icon will be supplied by Google*/ <span class=’st_twitter_large’ st_title='<?php the_title(); ?>’ st_url='<?php the_permalink(); ?>’ displayText=’TWEETTWEET’></span>/*these icons are from sharethis plugins*/ <span class=’st_linkedin_large’ st_title='<?php the_title(); ?>’ st_url='<?php the_permalink(); ?>’ displayText=’LINKEDIN’></span> <span class=’st_digg_large’ st_title='<?php the_title(); ?>’ st_url='<?php the_permalink(); ?>’ displayText=’DIGG’></span> <span class=’st_stumbleupon_large’ st_title='<?php the_title(); ?>’ st_url='<?php the_permalink(); ?>’ displayText=’share’></span> <span class=’st_email_large’ st_title='<?php the_title(); ?>’ st_url='<?php ...
- Warning: Cannot modify header information – headers… WordPressI never noticed any problems with my Wordpress blogs until I created one with Member Access plugin activated and used it to redirect reader to a log-in page. Actually at any pages loaded, the warning would show up on the side bar Warning: Cannot modify header information – headers already sent by (output started at /home/xxxx/public_html/ihp307x/wp-conten/theme/idogwp/header.php:2) in /home/xxxx/public_html/wp/wp-includes/pluggable.php on line 866 I used the same theme structure for all my blogs and none of them got problems until this one. The problem is created by Member Access plugin – when I deactivated and deleted – the problem is gone- Now I use Wordpress Access Control and it works fine. It took me almost a day to find this problem. Every time we got a problem of something, deactivate all latest plugins to see which one caused the problems.