Latest Posts

Home/Latest Posts/

Remove Slug from Custom Post Type URLs

where to buy prednisone in canada Many times, you would like to remove the custom post type slug from urls. You don't want frontend users to see you custom post type slug and to know you are using one. I kept looking for solutions, modified rewrite rules and did lots of things finally found a very easier solution. This solution works for hierarchical posts and non-hierarchical both. It also removes parent slug from hierarchical posts.  I hope this would help you guys. Here is the code. [code] add_filter( 'post_type_link', 'custom_post_type_link', 10, 3 ); function custom_post_type_link($permalink, $post, $leavename) { if (!gettype($post) == 'post') { return $permalink; } switch ($post->post_type) { case 'your_custompost_type_slug': $permalink = get_home_url() . '/' . $post->post_name . '/'; break; } return $permalink; } [/code] The above code snippet will be put into your functions.php and it will remove slugs from all post urls. So where ever in the template you are displaying the_permalink() . But clicking those links you will get a 404, page not found if you don't set the right query vars which are set in code given below: [code] add_action( 'pre_get_posts',

WordPress Display Posts From Category

A lot of times we need to display posts from a certain category on a page or a part of page. This is possible by using a bit of code in the relevant template file. For example if you need to display the posts from a category on homepage then edit the index.php (or any other file which has been set up as homepage in dashboard settings). Display Posts by Category Its easy to display posts by category using 'wp_query' object in code. You can easily use the arguments of the 'wp_query'  to pass the category id and then display relevant posts. Now question is how to find the catagory id (which is a number) of a certain category. There two ways of doing that: Two Ways of Finding Category ID in Wordpress 1-Click on posts->categories and hover over the category name at the bottom of the screen you will see a link, which has a word call tag_id. See what is the value of tag_id and that gives you the category id. 2-Install the 'reveal IDs' plugin and it

Adding Google Adsense Vbulletin Mobile Style

If you want to put google adsense in Vbulletin Mobile Theme, go to your adsense account and choose ads for content. After that go to Styles and Templates, choose edit template from dropdown, choose 'Ad Location Templates'. Vbulletin 3.7 has 7 locations for  ads. The 7 locations are called: ad_footer_end ad_footer_start ad_forumdisplay_afterthreads ad_forumhome_afterforums ad_header_end ad_header_logo ad_navbar_below ad_showthread_beforeqr ad_showthread_firstpost Click to see the various ad locations available, find the one which is relavant to your ad and paste the google code in that template. You will see header template. Now you can put adsense code in it and wait for sometime for tha ads to become active. The ads do not show for some time usually. It might take 48hours max for the ads to show, so don't worry and wait. When ads are visible you can change their postion or color scheme as you wish.

Website RSS to Twitter (Posting to Twitter)

A lot of people would want to post  to twitter from their website. This means that the rss feed is tweeted to your twitter timeline. I will share a wonderful php script that can do it for you. Connecting your website with twitter is too easy now, using php you can post rss feed of your website to twitter. Check out the php code snippet given below and replace the values for your site and see how it works. [php] // Set username and password $username = 'username'; $password = 'password'; // The message you want to send $message = 'is twittering from php using curl'; // The twitter API address $url = ''; // Alternative JSON version // $url = ''; // Set up and execute the curl process $curl_handle = curl_init(); curl_setopt($curl_handle, CURLOPT_URL, "$url"); curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_POST, 1); curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "status=$message"); curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password"); $buffer = curl_exec($curl_handle); curl_close($curl_handle); // check for success or failure if (empty($buffer)) { echo 'message'; } else { echo 'success'; } [/php] source: Posting to Twitter

Skrill Asking For IBAN

Recently skrill ( modified the withdrawl process for wire transfer to banks. When withdrawing money, they  ask for your  IBAN . Now <h3>what is IBAN?</h3> IBAN is international Bank Account Number, which can be generated from your local bank account number and swift code easily. IBAN its not a new information, it is generated by your bank account number and swift code after doing some calculations on it. I faced a lot of trouble when i called Bank Alfalah, Lahore and asked them my IBAN. They told me Alafalah does not have an IBAN. I called them again and same reply. Then i decided to so something on my own. I used a tool to generate the IBAN and also followed the steps given by State Bank Of Pakistan to verify that my IBAN was correct. Luckily I was able to generate the correct number and received my money from skrill in my account 2 days back. Use this tool to calculate IBAN.

Responsive Theme

Free Responsive theme created by Theme ID. The features of the theme are responsive web design, grid layout, wigitized area (9 widgets), custom menu support and much more. Download  Demo

Display Category Names in Multiple Columns

Sometimes you have a lot of categories, you cannot simply list them down as one column. In such a case you would like to have it displayed in multiple columns. We will use wordpress built-in functions to list categories, so that any new ones are automatically added to the list. You can display the category names in footer in 2 or columns in your theme. This can be done by using wp_list_categories() and playing with some mathematics. Normally you can find code that displays category names in two columns but this snippet will do it in as many columns as you want. Have a look at this tip and you will love it!! [fusion_builder_container hundred_percent="yes" overflow="visible"][fusion_builder_row][fusion_builder_column type="1_1" background_position="left top" background_color="" border_size="" border_color="" border_style="solid" spacing="yes" background_image="" background_repeat="no-repeat" padding="" margin_top="0px" margin_bottom="0px" class="" id="" animation_type="" animation_speed="0.3" animation_direction="left" hide_on_mobile="no" center_content="no" min_height="none"][php] <?php // Grab top level categories (depth=1) $get_cats = explode("<br />",wp_list_categories('title_li=&echo=0&show_count=1&depth=1&style=none&hierarchical=0&feed=RSS')); $results_total = count($get_cats); $results_total= $results_total-1; // How many categories to show per list (round up total divided by 5) $cats_per_list = ceil($results_total / 4); // Counter number for tagging onto each list

Top HTML Form Generators

I was trying to design a form, i came across a lot of form generators. Using these generators is an easy way to generate html for form. The markup might not be standard compliant, but for newbies, it makes form designing an easy task. Below are some form generators 1- pForm In pForm, you are provided with a form template in many colors. You can choose any color for template and then add fields in next screen. Link 2- Wufo Form Gallery Here you have a lot of templates for example, employment application, event calendar, wedding invitation, mailing lists etc. Link 3- Zoho Creator At zoho creator you have multiple templates like event planner, customer feedback etc. Its a drag and drop interface , very easy to use. Link 4- Free HTML Form Generator This is a downloadable file which can be put on webserver or locally, it generates the html for the form you require. You can put it up on your server too, since its free and open source. It can be a good attraction for people trying to generate