how to display post count of all wordpress tags

In this article, wordpress tutorial, how to display post count of all wordpress tags. In wordpress post we use post tags. For SEO purpose we can show post tags.

how to display post count of all wordpress tags

If we want to show the post count related to wordpress tags.

You can use following code:

<?php
//list all tags that are assigned to posts
$taxonomy = 'post_tag';
$terms = get_terms( $taxonomy, '' );
if ($terms) {
foreach($terms as $term) {
if ($term->count > 0) {
echo '<p>' . '<a href="' . esc_attr(get_term_link($term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $term->name ) . '" ' . '>' . $term->name.'</a> has ' . $term->count . ' post(s). </p> ';
}
}
}
?>
how to display post count of all wordpress tags
how to display post count of all wordpress tags

How to get page id by slug wordpress theme

WordPress tutorial for, How to get page id by slug wordpress theme. First find the page id using page title or page page slug.  we given sample code here.

How to get page id by slug wordpress theme

For post title use following code:

<?php
$page = get_page_by_title( 'About' );
wp_list_pages( 'exclude=' . $page->ID );
?>

For post slug use following code:

 $page = get_page_by_path( 'your-page-slug'
echo $page->ID;

Now List the child page by post slug

if ( $page = get_page_by_path( 'your-page-slug' ) ){
  wp_list_pages( 'orderby=name&depth=1&order=DESC&show_count=0&child_of=' .$page->ID . '&title_li=' );
}

show pdf in post on wordpress

There are people who are struggling for showing PDF file in there wordpress post. Please use following steps for show pdf in post wordpress.

show pdf in post wordpress

1) Go to media -> Add New, upload a file. Once file is uploaded, you will get File URL. Copy that file URL. (Let me call it MY_PDF_URL)

This will be a complete URL, with http://yourdomain.com in it..
2) Now, go to add new post and switch to html editor. Place this code where you want to show the pdf file….

[viral-lock message=”Solution 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.”]

<embed src="MY_PDF_URL" width="600" height="400">

This will work smoothly. OR you can use following code as well.


<iframe src="http://docs.google.com/gview?url=https://purabtech.in/wp-content/uploads/yourpdf.pdf&embedded=true" style="width:880px; height:1200px;" frameborder="0">

[/viral-lock]

There are also nice wordpress plugins for showing the PDF in wordpress posts.

Embed PDF

Will embed a PDF file using Google Docs Viewer Simply include the URL for a PDF document on it’s own line, or wrapped in the embed tag like

Click to access file.pdf

and the plugin will embed the PDF into the page using the Google Docs Viewer embed code. The url must end with .pdf

Supported attributes in the embed tag are class id title height and width

GroupDocs Word, Excel, Powerpoint, Image and PDF Annotate

GroupDocs Annotation lets you embed several types of files into your WordPress pages using the GroupDocs Viewer – allowing inline viewing and annotation of the following file types, with no Flash or PDF browser plug-ins required:

  • Adobe Acrobat (PDF)
  • Microsoft Word (DOC/DOCX)
  • Microsoft Excel (XLS/XLSX)
  • Microsoft PowerPoint (PPT/PPTX)

GroupDocs Annotation lets you view and comment on documents online. Its document annotation features makes it a powerful tool for collaboration. You and your colleagues can collaborate on a document, at the same time, to improve communication and speed up document reviews. GroupDocs Annotation lets you work with text-based documents as well as images. You can collaborate on layouts, drawings and designs just as effectively as on articles, stories and corporate documents. In short GroupDocs Annotation lets you annotate on many file formats including PDF’s, Word documents, Excel documents, Powerpoint documents and many other available formats.

show pdf in post wordpress
show pdf in post wordpress

 

for showing flash intro in sites and flash with wordpress website, we have written article. You might need for your website.

List of wordpress plugin development framework

Many wordpress developers want to develop new wordpress plugin for various purpose. We given the List of wordpress plugin development frameworks which useful. If you are looking for some ready-made wordpress plugin development frameworks.

List of wordpress plugin development framework

I found some good plugin frameworks which are helpful for developing the wordpress plugin.

Gives authors of new plugins a leg up on creating a great, easy to
maintain plugin by providing a carefully designed plugin skeleton to build on.
Authors of existing plugins can extract individual components and concepts
for transplantation into their own projects.

 

  • JeffreyWay / WordPress-Theme-Options-Page

open source class the project is hosted on github aimed at theme developers, looks nice, haven’t used it. .

 

  • helgatheviking / thematic-options-KIA

open source Framework the project is
hosted on github aimed at help developers build options into their thematic child themes , witch was forked for Thematic-options very much up to date.

 

a commercial solution, packed it features and very easy to use.

 

  • devinsays / Options-Framework

open source Framework the project is hosted on github aimed at theme developers , i later learned that is has evolved in to Thematic-options very large scaled project that has lots of features.

 

and IDE for creating option panels , lots of feature and constantly updated, downside is: it’s not easily integrated in plugins or themes and default options are not an option (up to version 1.1.1).

 

 

has related classes, I used it for one plugin and it saved me plenty of time;

 

I see a lot of mentions for this around, hadn’t used it myself yet;

 

has set of functions for pages/metaboxes/settings, but it probably won’t make sense to use it just for that.

list of wordpress plugin development framework
list of wordpress plugin development framework

solved: unable to upload images in wordpress

This is very common issue with wordpress websites. Many times we solved (unable to upload images in wordpress) same issue So we written detailed article on same topic. This is very common issue with linux or windows server or computer. When you do the wordpress setup you need to give the write able permission to your wp-content/uploads folder.

If you got the following error: when you upload the image.

“Screen Shot 2013-01-28 at 13.53.32 PM.png” has failed to upload due to an error: Unable to create directory wp-content/uploads/2013/01. Is its parent directory writable by the server?

if you are using windows then right-click the uploads folder and uncheck the is read checkbox. Change ownership of uploads folder. Change owner to apache.

solved: unable to upload images in wordpress

if you are using the linux then use following command:


chown apache:apache -R wp-content/uploads

solved: unable to upload images in wordpress
solved: unable to upload images in wordpress

 

wordpress user search firstname lastname and display name code

In wordpress admin users listing page, wordpress admin has user search with username and email but we cannot search via display name or first name and last name.

We can add firstname, lastname and display name in users search. You just need to add following code.

/*
 * functions will be applicable for only wordpress admin
 */
if (is_admin()) {
 /*
 * Modify the User Search in Admin to include firstname, lastname and display_name
 */
 add_action('pre_user_query', 'wpapi_pre_user_query');

function wpapi_pre_user_query($user_search) {
 //die();
 global $wpdb;
 // print_r($user_search);
 $vars = $user_search->query_vars;
 if (!is_null($vars['search'])) {
 /* For some reason, the search term is enclosed in asterisks.
 Remove them */
 $search = preg_replace('/^\*/', '', $vars['search']);
 $search = preg_replace('/\*$/', '', $search);
 //print_r($search);
 //search in display name
 if(!empty($search)){
 $user_search->query_where = substr(trim($user_search->query_where), 0, -1) . " OR display_name LIKE '%". $search . "%')";
 }

 $user_search->query_from .= " INNER JOIN {$wpdb->usermeta} m1 ON " .
 "{$wpdb->users}.ID=m1.user_id AND (m1.meta_key='first_name')";
 $user_search->query_from .= " INNER JOIN {$wpdb->usermeta} m2 ON " .
 "{$wpdb->users}.ID=m2.user_id AND (m2.meta_key='last_name')";
 $names_where = $wpdb->prepare("m1.meta_value LIKE '%s' OR m2.meta_value LIKE '%s'", "%{$search}%", "%$search%");
 $user_search->query_where = str_replace('WHERE 1=1 AND (', "WHERE 1=1 AND ({$names_where} OR ", $user_search->query_where);
 }
 return $user_search;
 }

}

wordpress user search firstname lastname and display name code
wordpress user search firstname lastname and display name code

install and update the wordpress plugins without providing ftp access

I did so much R&D about installing and updating the wordpress plugin without using ftp access. I got very nice trick to solve this issue. When you are using the shared hosting or VPS server for wordpress site hosting. You always face issue for installing the wordpress plugin or wordpress theme. It issue happen when you do the the wordpress updation. Using following simple steps you can install the wordpress plugins and themes without giving the ftp access.

update wordpress plugins without ftp access

I always did the wordpress plugins and theme updation. So every time providing the ftp credentials are really panic. So I am always using following steps for doing wordpress up-gradation.

First you need to add the following code in your wp-config.php file.

define('FTP_USER', 'username');
define('FTP_PASS', 'mypassword');
define('FTP_HOST', '192.168.2.132');
define('FTP_SSL', false);

But this is old idea. If you dont want to add the ftp access in wp-config.php file then Just add the following line wp-config.php file.


define('FS_METHOD', 'direct');

Note: You need to give 755 permission to wp-content folder. Create the upgrade folder in wp-content folder.

If still you are facing issue then give 777 permission to all wp-content folder.

For permission use following command

cd your_wordpress_directory
sudo chown -R www-data wp-content
sudo chmod -R 755 wp-content

More information:

WordPress will try to write a temporary file to your /wp-content directory. If this succeeds, it compares the ownership of the file with it’s own uid, and if there is a match it will allow you to use the ‘direct’ method of installing plugins, themes, or updates.

Now, if for some reason you do not want to rely on the automatic check for which filesystem method to use, you can define a constant, 'FS_METHOD' in your wp-config.php file that is either 'direct' 'ssh', 'ftpext' or 'ftpsockets' and it will use method. Keep in mind that if you set this to ‘direct’ but your web user (the username under which your webs server runs) does not have proper write permissions, you will receive an error.

update wordpress plugins without ftp access
update wordpress plugins without ftp access

add google plus button to wordpress without plugin

Many people asking me how to add the google plugin button in wordpress without plugin. WordPress tutorial for, add google plus button to wordpress without plugin. You can easily add the google plus button counter to your wordpress website.

add google plus button to wordpress without plugin

I added the google button code to digcms.com site.

You just need to add the following code to site.


&lt;!-- Place this tag where you want the +1 button to render --&gt;
&lt;g:plusone size=&quot;tall&quot;&gt;&lt;/g:plusone&gt;

&lt;!-- Place this render call where appropriate --&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
 (function() {
 var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
 po.src = 'https://apis.google.com/js/plusone.js';
 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
 })();
&lt;/script&gt;

For getting the different style of google plus button you can go to following site.

http://www.google.com/webmasters/+1/button/

add google plus button to wordpress without plugin
add google plus button to wordpress without plugin

Add feedburner email subscription wordpress without plugin

WordPress tutorial for, Add feedburner email subscription wordpress without plugin. We given full detailed explanation with screenshot and steps for adding feedburner email subscription wordpress without plugin.

Many blogger and people want to add the feedburner RSS feed email subscription form in their website.

Add feedburner email subscription wordpress without plugin

What is RSS?

The easiest way to receive latest posts from your favorite blogs is to subscribe to RSS using feed readers such as Google Reader, Bloglines, NetVibes.
RSS (means Really Simple Syndication) retrieves the latest content from the sites you are interested and pulls them into your feed reader where you can read them all in one location rather than visiting each site separately.

What is FeedBurner?

Most blogs have RSS feed which is detected automatically by commonly used feed readers when the blog URL is added to the reader.

 

Setting Up Your Feedburner Feed

1.  Go to Feedburner and sign in to Feedburner with your Google Account (create a Google Account first if you don’t have one!).

However, if you want to make it more obvious and easier for readers to subscribe using RSS, or want to know exactly how many people subscribe to your blog then the best option is to add a Feedburner RSS feed and email subscription to your blog.

 

After creating feedburner account go to

1.  Click on the Publicize Tab > Email Subscription in your Feedburner account and click on Activate.

2.   Copy the HTML code.

Add feedburner email subscription wordpress without plugin
Add feedburner email subscription wordpress without plugin

 

After this go to wordpress admin panel and go to widget section and choose text widget.

Add a text widget to the desired sidebar by dragging it from the Available Widgets into the Sidebar area on the right.

The widget will automatically open — just add the HTML code for Feedburner email subscription, click Save and then Close.

 

This widget will look as follows:

Add feedburner email subscription wordpress without plugin
Add feedburner email subscription wordpress without plugin

If you like this article then please subscribe my blog.

How to add custom post type to wordpress menu

WordPress tutorial, for developer, Many people wondering How to add custom post type to wordpress menu. Best idea is first create page with custom post type.

For example you created custom post type art then you need to create page name with art. Then create template with name of art.

How to add custom post type to wordpress menu

Add following code in that file.

<?php /* Template Name: Art */
$loop = new WP_Query( array( 'post_type' => 'art', 'posts_per_page' => 10 ) );
while ( $loop->have_posts() ) : $loop->the_post();
the_title();
the_content();
global $post;
$custom = get_post_custom($post->ID);
echo '<div>';
the_content();
echo '</div>';
endwhile;
?>

Than open your appearance-Menu and add the Art page in navigation or main menu.

Using this trick you can easily add the custom post type in wordpress navigation.

How to add custom post type to wordpress menu
How to add custom post type to wordpress menu