How to show related posts wordpress without plugin using category. Showing related article in wordpress site is always good for users to attract visitors. In many blogs people are showing the related or linked articles. Showing similier or related articles will increaze your site SEO. show related posts without wordpress plugin using category in wordpress site is always good for users to attract the visitors.
show related posts wordpress without plugin
More visitor will visit your site. For showing the related articles you need copy following code into your functions.php file.
[viral-lock message=”Code is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]
// "Similier Articles"
function wpapi_more_from_cat( $title = "Similier Articles:" ) {
global $post;
// We should get the first category of the post
$categories = get_the_category( $post->ID );
$first_cat = $categories[0]->cat_ID;
// Let's start the $output by displaying the title and opening the <ul>
$output = '<h3>' . $title . '</h3>';
// The arguments of the post list!
$args = array(
// It should be in the first category of our post:
'category__in' => array( $first_cat ),
// Our post should NOT be in the list:
'post__not_in' => array( $post->ID ),
// ...And it should fetch 5 posts - you can change this number if you like:
'posts_per_page' => 5
);
// The get_posts() function
$posts = get_posts( $args );
if( $posts ) {
$output .= '<ul>';
// Let's start the loop!
foreach( $posts as $post ) {
setup_postdata( $post );
$post_title = get_the_title();
$permalink = get_permalink();
$output .= '
<ul>
<li>permalink . '" title="' . esc_attr( $post_title ) . '">' . $post_title . '</li>
</ul>
';
}
$output .= '</ul>';
} else {
// If there are no posts, we should return something, too!
$output .= '<p>Sorry, this category has just one post and you just read it!</p>';
}
echo $output;
}
[/viral-lock]
After that open your single.php file and use following code.
wpapi_more_from_cat();
show related posts wordpress without plugin
Using above code you can show the related articles in your wordpress site.
WordPress tutorial, How to wordpress secure file upload using apache rules, Here we given apache rule for secure your wordpress file upload functionality.
How to wordpress secure file upload using apache rules
Website security is most important point of any website. In wordpress we need to give 777 permission to wp-content/uploads folder. Some time we don’t want to give the 777 (read, write and execute) permission to folder due to security reason but wordpress do not allow you to upload images or media files to uploads folder.
Tip: Do not give 777 permission to wp-content/uploads folder. In stead change user ownership to apache folder.
Security
What you can do is. You can restrict other file types to upload in uploads folder using simple apache rule. following code you can use in .htaccess file.
Order Allow,Deny
Deny from all
<FilesMatch ".(jpg|jpeg|jpe|gif|png|tif|tiff)$">
Order Deny,Allow
Allow from all
Using above code you can secure your uploads folder and only selected files can be pushed into uploads folder.
How to wordpress secure file upload using apache rules
There are many wordpress plugins which using the shortcode. But you easily create custom shortcode for wordpress site. there is no need of external plugin.
custom shortcode for wordpress
Since Version 2.5 WordPress support so called Shortcodes. They have been introduced for creating macros to be use in a posts content. Many people looking for how to create the shortcode in wordpress using theme. It is very easy to build shortcode in wordpress. I given very simple code sample for creating the custom shortcode.
For more information visit following page.
For creating the custom shortcodes you need add following method in functions.php file which is located in your theme folder.
function myshortcode(){
return '<img src="http://images.purabtech.in/How-to-make-empty-the-wordpress-trash-automatically.png">';
}
add_shortcode('myshortcode', 'myshortcode');
custom shortcode for wordpress
you can change the return text or shortcode name aslo.
One of my client faced issue with Autor drop down which is in Admin section.
Display the authors in dropdown menu using hooks.
While creating the New post there was problem with the Author field. There are hundreds of irrelevant selections (users) and it’s difficult to select the right one.
WordPress is by default showing all the users in author drop down. I don’t want to show the other users in author drop down.
Hook/Filter – In wordpress Admin -Add new Post section -Display the authors in a dropdown menu using wp_dropdown_users One of my client faced issue with Autor drop down which is in Admin section. Display the authors in a dropdown menu using hooks
I searched for wp_dropdown_users hook or filter. But I did not found any proper solution.
Following articles are found helpful to me.
http://wordpress.org/support/topic/filter-for-post-quick-edit-author-drop-down
http://codex.wordpress.org/Function_Reference/wp_dropdown_users
Using that code I modified the code and I am able to fix the issue. You can put following code in to functions.php file.
/*
* Hook for showing Admin and Author in Add new Post - Admin section dropdown menu
*/
function wpapi_override_wp_dropdown_users($output) {
global $post, $user_ID;
//get the Admin-role users IDs
$admins = getUsersWithRole('admin');
//get the author-role users IDs
$authors = getUsersWithRole('author');
//merge the array
$result = array_merge($admins, $authors);
//array converted into comma seprated string
$authorsall = implode(",", $result);
// return if this isn't the theme author override dropdown
if (!preg_match('/post_author_override/', $output))
return $output;
// return if we've already replaced the list (end recursion)
if (preg_match('/post_author_override_replaced/', $output))
return $output;
// replacement call to wp_dropdown_users
$output = wp_dropdown_users(array(
'echo' => 0,
'name' => 'post_author_override_replaced',
'selected' => empty($post->ID) ? $user_ID : $post->post_author,
'include_selected' => true,
'include' => $authorsall
));
// put the original name back
$output = preg_replace('/post_author_override_replaced/', 'post_author_override', $output);
return $output;
}
add_filter('wp_dropdown_users', 'wpapi_override_wp_dropdown_users');
/*
* Find User IDs by Role
*/
function getUsersWithRole($role) {
$wp_user_search = new WP_User_Search($usersearch, $userspage, $role);
return $wp_user_search->get_results();
}
Using above code, you can load multiple role users in author drop down.
Smiles and emoticons are always important show your expressions in short way. Earlier also I posted articles about same. Here is link about that. here in this article written about animated smileys. I given very detailed information to use animated smileys and emoticons in wordpress. animated smilyes and emotions are used everywhere now in mobile device.
use animated smileys and emoticons in wordpress
By default wordpress supports some basic emoticons. Here I can suggest some very cool wordpress plugins.
Kaskus Emoticons is an emoticon set inspired by Kaskus, the Largest Indonesian Community – consisting of over a million active members from all over the world. The images which are used in this plugin are copyright of Kaskus
Speedy Smilies takes emoticons in WordPress to the next level (where it should be already and hopefully one day will). The end goal is to make smilies load faster in the browser for visitors and make them easy to insert into posts/pages for authors. In addition to the speed benefits, Speedy Smilies allows authors to easily change the appearance of emoticons using smiley sets.
Speedy Smilies is free software licensed under the GNU GPL version 3.
Tango Smileys Extended
Tango Smileys Extended (TSE) disables the built-in WordPress smileys and extends the number of available smileys from 18 to 202. The extended smileys can be input using standard emoticon shorthand, or through the CTI (Click to Insert) interface. Smileys in comments is supported and may be inserted using the standard emoticon shorthand or through the CTI interface. MCEComments is also supported.
This version of Tango Smileys Extended is for WordPress 2.8+
WordPress versions pre-2.8 are no longer supported. If you are using WordPress 2.7.x, please use Tango Smileys Extended 2.5.4.1. WordPress 2.6.x and earlier are only supported in versions of Tango Smileys Extended older than, and including, 2.5.2.8.
This addon will add a button to your visual tinymce editor for posts/pages. Clicking the button will open a popup window with over 50 professionally animated .gif smiley’s.
You can insert these smiley’s into your post/page content areas. Simply click a smiley, and it is automatically inserted into your content area.
Replaces WordPress’ smileys (based on images) with font-based emoticons (see screenshots). Font-based emoticons have some advantages:
They have the same size as the surrounding text. No more distorting the heights of lines containing smileys/emoticons. They always fit the font size.
They have the same color as the surrounding text.
The following emoticons are supported:
:):-):smile:
:(:-(:sad:
;);-):wink:
:P:-P:razz:
-.--_-:sleep:
:thumbs::thumbsup:
:devil::twisted:
:o:-o:eek:
8O8o8-O8-o:shock: (No real icon for “shock” yet. Using “eek” instead.)
:coffee:
8)8-)B)B-):cool:
:/:-/
:beer:
:D:-D:grin:
x(x-(X(X-(:angry:
:x:-x:mad: (No real icon from “mad” yet. Using “angry” instead.)
O:)0:)o:)O:-)0:-)o:-):saint:
:'(:'-(:cry:
:shoot:
^^^_^:lol:
Notes: * Emoticons must be surrounded with spaces (or other white space characters); e.g. the emoticon in that:)smile won’t be replaced * Emoticons won’t be replaced in HTML tags nor in <pre> or <code> blocks.
wp-monalisa is the plugin that smiles at you like monalisa does. place the smilies of your choice in posts, pages or comments.
There are a lot plugins for smiley support out there and some of them are really useful. Most of them don’t work out of the box and this is what wp-monalisa tries to achieve, giving you the ability to maintain your smilies and even turn them into img tags.
it’s easy and it smiles at you…what else do you want?
Features:
maintain your smilies in a separate directory
activate or deactivate smilies for posts or comments
replace smilies with img tags
extend or replace wordpress smiley replacement
while edit posts or pages, pops-up in a draggable meta-box
extends your comment form to give you visitors the freedom to smile 🙂
support for fckeditor (tested with v3.3.1)
fully integrated ith BuddyPress
use animated smileys and emoticons in wordpress post
Many wordpress theme developer use following method for developing the wordpress theme. we given Solution to develop wordpress theme with minimal impact and with minimum coding effort.
Copy the wordpress base theme (like twentytwelve in wordpress 3.5)
Rename the folder and converted index.html of my HTML to index.php for wordpress theme.
Replace style.css with current theme style.css.
Solution to develop wordpress theme with minimal impact
This easy way to creating the new theme or you can use the frameworks like as follows:
http://digcms.com/wordpress-themes/apticus/
At the very minimum, a WordPress Theme consists of two files:
style.css
index.php
Here are some resources for faster theme development
Here we have List of some minimal, fast loading and small free wordpress themes. Fast loading wordpress theme is good for seo. Try to use minimal theme, It will load faster and your visitor bounce rate will reduce. If you excepting high traffic to website than this wordpress theme list will be useful to you.
some minimal, fast loading and small free wordpress themes
Some time due host hosting or server capabilities you need use the minimal themes. Using fast loading wordpress themes always good for seo also. Google checks how fast your site is loading. If your wordpress site is taking too much time to loading than user will go away from your site. So many web bloggers use the minimal and fast loading free wordpress themes.
Here I created a list of some very fast loading and small free wordpres themes.
This list is created by wordperssapi.com. If you are having any suggestions about any minimal theme then please write to us on support@purabtech.in or put comment.
Many people want to show there pdf files in wordpress blog. PDF is really popular format for showing the document with graphics and text and design and graphs. Without loosing the quality of text and graphics if we need to show the content then PDF is really nice format.
pdf in wordpress
pdf in wordpress
In business world for presentation purpose all people mostly use the PDF document. Some wp developers asked about showing the pdf in wordpress.
For without any issue if you want to show the PDF document then you need to just open functions.php file and put following code in that file.
Following code I written for creating the shortcode in wordpress
Note: Upload the PDF file to your wordpress and then get the path of PDF file and then put above lines in article.
Change the path as you required.
Above code will create pdf link for your pdf document in your site.
If you does not want to create PDF link in your site and you want to show the pdf doc in your site then use following code.
We are looking for pdf in wordpress post, wordpress pdf tutorial, wordpress tutorial, wordpress documentation pdf, wordpress ebook pdf, wordpress book, wordpress ppt, wordpress tutorial for beginners this for wordpress. Here we can add the pdf support using my code in your wordpress sites.