Add Shortcodes To Sidebar

  • by

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

  • WP-5.6 Breaks My Themes
    After updated WP-5.6, my search, home and others became black screen with a close x, but it can’t be closed. I needed to download WP-downgrade to reinstall WP-5.5.3 and everything is back to normal. This breaks both desktop and mobile screens.
  • Unknown error (invalid-json) WordPress Login
    For some unknown reasons, when I tried to log into Wordpress to edit or add posts, the screens came up with “Unknown error (invalid-json). Please contact an administrator for more info.”. I tried my test blog without the BWP reCaptcha and I could log in without any problem. So I renamed the plugin and voila, the error message is gone and I can log in without any problems. This problem also exist in the comment section, we also need to remove the option for the comment if we want to use this.
  • Swipebox and Pop Ups
    We need to have a lightbox type to display pictures and galleries with the support of mobile swiping. Swipebox is free.
  • FancyBox3 For WordPress
    I like the FancyBox3 swipe features for displaying multiple images. Although it doesn’t take the title as data-caption and the position of the caption can’t be used relative to the bottom of the display image. The is quite simple to use. Since this one only needs jquery 1.9.1 minimum, I could use with imagePreview.
  • How To Embed Audio Player in HTML
    <embed name="dognmonkey" src="/music/dognmonkey/idog1.mp3" autostart="true" loop="true"></audio> <audio src="/music/dognmonkey/idogsunday.mp3" controls></audio>
  • How To Create Sprites and Use Icons with CSS
    Create a sprite with Instant Sprite: download the png sprite image and usage. CSS codes: #return_top a,#youtube a, #bird a{position:fixed;bottom:1px;display:block;width:2.5rem;z-index:100001} #fixed_icons{background:linear-gradient(270deg,#ddd,#777 80%) no-repeat;padding:0 2%;position:fixed;width:100%;height:2.5rem;bottom:0;margin:0 auto;z-index:10001} #home_icon a{position:fixed;right:44px;bottom:1px;display:block;height:43px;width:44px;background:url(images/mysprite.png) -100px 0; no-repeat;z-index:100001} #return_top a{right:0;height:40px;background:url(images/mysprite.png) 0 0; no-repeat}#youtube a{right:90px;height:40px;background:url(images/mysprite.png) -50px 0; no-repeat} #bird a{right:135px;height:40px;background:url(images/mysprite.png) -156px 0; no-repeat} footer codes: <div id="fixed_icons"> <div id="return_top"><a href="#masthead" title="Go To Top"></a></div><div id="home_icon"><a href="<?php echo esc_url(home_url('/')); ?>" title="Go Home"></a></div> <div class="fb-share-button" data-href="" data-size="large" data-layout="button_count"> </div> <div class="fb-like" data-href="" data-size="large" data-layout="button_count" data-action="like" data-show-faces="true"> </div> <a href="" title="tweet post" target="_blank"><div id="bird"></a></div> <p id="youtube"><a href="" title="Youtube Channel" target="_blank"></a></p> </div>  
  • lightGallery test
    No longer used, used magnific popup instead…
  • Install GTX 1060 to Dell DT 3668 PC
    My daughter wanted to play high resolution game on the small Dell DT 3668 PC we bought last year. The power supply is too small and under powered. I need to customize it somehow. We need a 12V relay – Inputs are from the 12V off the Hard Drive connector – The 2 output pins connected to the Green and the Black of the 24 pin external PSU. 

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Paid Links