Add Shortcodes To Sidebar

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).

  • Remove Babylon Search On Firefox And IE9
    Babylon Search engine is installed in Firefox when you least expected from installing some software like Super video encoding. If you don’t know how to get rid of it correctly, it will come back every time you click a new tab or open a new Firefox browser. This is how I fixed mine. In the address bar, type “about:config”      In the “search” box type “babylon” and everything with babylon will come up.      for keyword.URL we can set to “//www.google.com/search?q=”      Now we can set default homepage to whatever we want by click Tools-Options-General and type in the address.      IE9 (Internet Explorer)      Other search engine tool bars are easy to get rid of, except this one. Cheers,
  • Re-sized Images Fail To Display On WordPress
    I change and modify themes once in a while when I found some nice lay-out themes. Some themes cause my re-sized images NOT to display as the sizes defined in the editor WYSIWYG. It’s the CSS problem.      Open the css file and look for “.post img”, there are 2 settings can cause this problem. If the theme is fluid on the content, which is scalable to the resolutions of reader screens (which all of our blogs are), if the “width” of the image is not defined as “max-width”, the images will scale to the width of the content or the original size which ever is smaller. The other problem is if the “width” is set to “auto”, remove it.      Remove “width=auto” and change “width=600px” to “max-width=600px” which ever the case may be, we solved our problem. If you happen to like mono-lab.net themes like me, you will have some other problem like putting 3 small iframes inline on a page. The design is to be like this. but the css keep display them like this I found the class that causes this problem in the CSS and I just remove it. Cheers, “
  • Add Excerpts To WordPress Main Page
    I like mono-lab themes, but none of them has excerpts built-in to list posts with excerpts on the main blog page. I found some codes that actually will work with any themes that don’t have excerpts functions at all. WordPress has built-in excerpts function, but the theme has to call it out to use. Depends upon the theme you use, on mono-lab piano-black and flat, 2 files that need to add codes to are function.php and index.php. Function.php codes: add these line any where in the function.php. Change the return # to the maximum characters we want to display, I set mine to 100 characters. function trim_excerpt($text) { global $post; return str_replace('', '<a href="'. get_permalink($post->ID) . '">' . '...' . __('Read More', 'flat') . '' . '</a>', $text); } add_filter('get_the_excerpt', 'trim_excerpt'); function custom_excerpt_length( $length ) { return 100; } add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 ); Index.php, Search.php, Archive.php codes: add these lines to replace the post codes between “post_content” and “wp_link_page” <div class="post_content"> <?php if (trim_excerpt('$text')){ the_excerpt(); } else { the_content(__('Read more', 'flat')); }?> <?php wp_link_pages(); ?> I added these codes to get excerpts on my main page of Flat theme from mono-lab
  • Category Post List
    8-24-12 Category Post List stops working when Wordpress Users is activated on WordPress 3.4.1.       Category Post List Plugin Usage, this is a great plugin to create a page to list all posts in all categories of the blog like this page. ‘ remove the ‘
  • Create A Home Button In WordPress
    I think it’s a good practice to have a home link button at the end of every page for readers to get back to the main page. Create a graphic button or download the free icon on the net: 1 for main and 1 for hover. If there is only 1 image, just use Paint.net to change color and save for hover image. Edit the style.css of the theme and create a home id. #idoghome { font-size:14px; float:right;background:url(/idogjs/css/home_48_hover.png) no-repeat right top; height:50px; padding:18px 0 0 55px; } #idoghome:hover { background:url(/idogjs/css/home_50.png) no-repeat right top; } Edit single.php and page.php and place the codes to add the hombutton link to where ever on the page you want it to be. I put it after the content and before the link to the pages of the post.   <?php the_content(__(‘Read more’, ‘piano-black’)); ?><?php edit_post_link(__(‘EDIT’, ‘piano-black’), ‘<li>’, ‘</li>’ ); ? <a id=”idoghome” title=”back to techs11″ href=”<?php echo home_url(); ?>”></a> <div><?php wp_link_pages(); ?></div> The result will look like this USING MOBIL PLUGIN WEBSITE If we’re using WP Mobile Pack plugin and we want to place this button at the end of the post, we need to add to “mobile_pack_base/style_structure.css” and “mobile_pack_base/index.php” #idoghome { font-size:14px; text-align:center;background:url(img/home_48_hover.png) no-repeat right top; height:50px; padding:25px 0 0 55px; } #idoghome:hover { background:url(img/home_50.png) no-repeat ...

Leave a Reply

Your email address will not be published. Required fields are marked *