1. How to get the postid in wordpress?
We can get the postid
global $wp_query;
$postid = $wp_query->post->ID;
echo $postid;
2. How to get the post meta value in worpdress?
We can get the post meta value throw postid.
For example here post Custom Field name : comapny name
get_post_meta($postid, 'Company name', true);
3. How to check if the post has a Post Thumbnail assigned to it.
if ( has_post_thumbnail() ) // check if the post has a Post Thumbnail assigned to it.
{
the_post_thumbnail();
}
4.how to get the wordpress featued image and how to change the image width and height.
We can get the featurd image wordpress function
the_post_thumbnail(); //here we can get the wordpress featured image thumbnail
the_post_thumbnail( array(100,100) ); // here we can change the image size.
5. How to get the specified category post only in wordpress?
Here we can get the all post in category id based.
<?php query_posts("cat=106 && per_page=5");// here 106 is the category id ?>
<?php while ( have_posts() ) : the_post(); ?>
<h3><?php the_title(); // here we can get the post title. this is the wordpress free defind function ?></h3>
<?php endwhile; ?>
10. Can I rename the WordPress folder?
We can get the postid
global $wp_query;
$postid = $wp_query->post->ID;
echo $postid;
2. How to get the post meta value in worpdress?
We can get the post meta value throw postid.
For example here post Custom Field name : comapny name
get_post_meta($postid, 'Company name', true);
3. How to check if the post has a Post Thumbnail assigned to it.
if ( has_post_thumbnail() ) // check if the post has a Post Thumbnail assigned to it.
{
the_post_thumbnail();
}
4.how to get the wordpress featued image and how to change the image width and height.
We can get the featurd image wordpress function
the_post_thumbnail(); //here we can get the wordpress featured image thumbnail
the_post_thumbnail( array(100,100) ); // here we can change the image size.
5. How to get the specified category post only in wordpress?
Here we can get the all post in category id based.
<?php query_posts("cat=106 && per_page=5");// here 106 is the category id ?>
<?php while ( have_posts() ) : the_post(); ?>
<h3><?php the_title(); // here we can get the post title. this is the wordpress free defind function ?></h3>
<?php endwhile; ?>
6. How to hide the top admin bar at the frontend of wordpress 3.4?
Add the below mentioned code in the theme(active) function.php
add_filter(‘show_admin_bar’, ‘__return_false’);
(or)
Add the below code in the active theme stylesheet
#wpadminbar {
display: none; visibility: hidden;
}
7. Run Any Query on the Database for WordPress.
The
query function allows you to execute any SQL query on the WordPress database. It is best to use a more specific function (see below), however, for SELECT queries. <?php $wpdb->query('query'); ?>
8. What are rules to follow in wordpress plugin development?
- Find a unique name
- Setup a prefix (related to your brand)
- Create the plugin’s folder
- Create sub-folders for PHP files, assets, and translations
- Create the main plugin file and fill in obligatory header information
- Create a readme.txt file
- Use proper constants and functions to detect paths to plugin files
- Create additional PHP files and include them inside the main one
- Create activation and deactivation functions
- Create an uninstall script
9. What is hooks and types of hooks in wordpress?
Hooks are provided by WordPress to allow your plugin to ‘hook into’ the rest of WordPress; that is, to call functions in your plugin at specific times, and thereby set your plugin in motion. There are two kinds of hooks:
- Actions: Actions are the hooks that the WordPress core launches at specific points during execution, or when specific events occur. Your plugin can specify that one or more of its PHP functions are executed at these points, using the Action API.
- Filters: Filters are the hooks that WordPress launches to modify text of various types before adding it to the database or sending it to the browser screen. Your plugin can specify that one or more of its PHP functions is executed to modify specific types of text at these times, using the Filter API.
If you have not already installed WordPress, you can rename the folder with the WordPress files, before, or even after uploading the files.
If you have already installed WordPress, and you want to rename the folder, login to the weblog as the administrator and change the following settings in Settings > General:
WordPress address (URI):
Blog address (URI):
Once you have done this, you can rename the directory or folder with the WordPress files in it.
11. Do I really need MySQL?
You certainly need the MySQL database server to power your WordPress blog. In fact, WordPress only supports the MySQL database server. Listed are the PHP and MySQL requirements:
WordPress server requirements for Version 3.2:
PHP version 5.2.4 or greater
MySQL version 5.0.15 or greater
(Optional)(Required for MultiSite) Apache mod_rewrite module (for clean URIs known as Permalinks)
12. Why does WordPress use MySQL?
MySQL is extremely fast. It is also the most widely available database server in the world. Open-source and free, MySQL is supported by thousands of low-cost Linux (and Windows!) hosts, which means a very low barrier to entry for anyone wanting to start a WordPress (or database-driven) website. MySQL’s documentation is useful, cogent and thorough. (Note: it may be intimidating if you are new to all this.) Add to all that the fact that users are able to directly manipulate MySQL with phpMyAdmin, developed expressly for that purpose, and it is obvious that MySQL is the best choice. Of course, WordPress insists on the best.
13. How do I disable comments?
First, unchecked Allow people to post comments on the article on the Options > Discussion panel. This will only disable comments on future posts. Now, to completely disable comments, you will have to edit each past post and uncheck Allow Comments from the Write Post SubPanel. Alternatively, you could run this MySQL query from the command line on a shell account or using phpMyAdmin: UPDATE wp_posts SET comment_status=”closed”;
If your goal is to permanently disable comments, then you should delete the wp-comments-post.php file as well.
14. What are the features of Wordpress?
- Simplicity Simplicity makes it possible for you to get online and get publishing, quickly. Nothing should get in the way of you getting your website up and your content out there. WordPress is built to make that happen.
- Flexibility With WordPress, you can create any type of website you want: a personal blog or website, a photoblog, a business website, a professional portfolio, a government website, a magazine or news website, an online community, even a network of websites. You can make your website beautiful with themes, and extend it with plugins. You can even build your very own application.
- Publish with Ease If you’ve ever created a document, you’re already a whizz at creating content with WordPress. You can create Posts and Pages, format them easily, insert media, and with the click of a button your content is live and on the web.
- Publishing Tools WordPress makes it easy for you to manage your content. Create drafts, schedule publication, and look at your post revisions. Make your content public or private, and secure posts and pages with a password.
- User Management Not everyone requires the same access to your website. Administrators manage the site, editors work with content, authors and contributors write that content, and subscribers have a profile that they can manage. This lets you have a variety of contributors to your website, and let others simply be part of your community.
- Media Management They say a picture says a thousand words, which is why it’s important for you to be able to quickly and easily upload images and media to WordPress. Drag and drop your media into the uploader to add it to your website. Add alt text, captions, and titles, and insert images and galleries into your content. We’ve even added a few image editing tools you can have fun with.
- Full Standards Compliance Every piece of WordPress generated code is in full compliance with the standards set by the W3C. This means that your website will work in today’s browser, while maintaining forward compatibility with the next generation of browser. Your website is a beautiful thing, now and in the future.
- Easy Theme System WordPress comes bundled with two default themes, but if they aren’t for you there’s a theme directory with thousands of themes for you to create a beautiful website. None of those to your taste? Upload your own theme with the click of a button. It only takes a few seconds for you to give your website a complete makeover.
- Extend with Plugins WordPress comes packed full of features for every user, for every other feature there’s a plugin directory with thousands of plugins. Add complex galleries, social networking, forums, social media widgets, spam protection, calendars, fine-tune controls for search engine optimization, and forms.
- Built-in Comments Your blog is your home, and comments provide a space for your friends and followers to engage with your content. WordPress’s comment tools give you everything you need to be a forum for discussion and to moderate that discussion.
- Search Engine Optimized When the head of Google’s web spam team says that WordPress is a great choice, taking care of 80-90% of the mechanics of search engine optimization for you, you know you’re on to a good thing. For more fine-grained SEO control, there are plenty of SEO plugins to take care of that for you.
- Multilingual WordPress is available in more than 70 languages. If you or the person you’re building the website for would prefer to use WordPress in a language other than English, that’s easy to do.
- Easy Installation and Upgrades WordPress has always been easy to install and upgrade. If you’re happy using an FTP program, you can create a database, upload WordPress using FTP, and run the installer. Not familiar with FTP? Plenty of web hosts offer one-click WordPress installers that let you install WordPress with, well, just one click!
- Importers Using blog or website software that you aren’t happy with? Running your blog on a hosted service that’s about to shut down? WordPress comes with importers for blogger, LiveJournal, Movable Type, TypePad, Tumblr, and WordPress. If you’re ready to make the move, we’ve made it easy for you.
- Own Your Data Hosted services come and go. If you’ve ever used a service that disappeared, you know how traumatic that can be. If you’ve ever seen adverts appear on your website, you’ve probably been pretty annoyed. Using WordPress means no one has access to your content. Own your data, all of it – your website, your content, your data.
- Freedom WordPress is licensed under the GPL which was created to protect your freedoms. You are free to use WordPress in any way you choose: install it, use it, modify it, distribute it. Software freedom is the foundation that WordPress is built on.
- Community As the most popular open source CMS on the web, WordPress has a vibrant and supportive community. Ask a question on the support forums and get help from a volunteer, attend a WordCamp or Meetup to learn more about WordPress, read blogs posts and tutorials about WordPress. Community is at the heart of WordPress, making it what it is today.
- Contribute You can be WordPress too! Help to build WordPress, answer questions on the support forums, write documentation, translate WordPress into your language, speak at a WordCamp, write about WordPress on your blog. Whatever your skill, we’d love to have you!
Developer Features
For developers, we’ve got lots of goodies packed under the hood that you can use to extend WordPress in whatever direction takes your fancy.
- Plugin System The WordPress APIs make it possible for you to create plugins to extend WordPress. WordPress’s extensibility lies in the thousands of hooks at your disposal. Once you’ve created your plugin, we’ve even got a plugin repository for you to host it on.
- Theme System Create WordPress themes for clients, customers, and for WordPress users. TheWordPress API provides the extensibility to create themes as simple or as complex as you wish. If you want to give your theme away for free you can give it to users in the Theme Repository
- Application Framework If you want to build an application, WordPress can help with that too. Under the hood WordPress provides a lot of the features that your app will need, things like translations, user management, HTTP requests, databases, URL routing and much, much more.
- Custom Content Types WordPress comes with default content types, but for more flexibility you can add a few lines of code to create your own custom post types, taxonomies, and metadata. Take WordPress in whatever direction you wish.
- The Latest Libraries WordPress comes with the latest script libraries for you to make use of. These include jQuery, Plupload, Underscore.js and Backbone.js. We’re always on the lookout for new tools that developers can use to make a better experience for our users.
15. Who is the founder of WordPress?
Matthew Charles Mullenweg.
16. How many tables a default WordPress will have?
A default wordpress will have 11 tables. They are-
1. wp_commentmeta
2. wp_comments
3. wp_links
4. wp_options
5. wp_postmeta
6. wp_posts
7. wp_terms
8. wp_term_relationships
9. wp_term_taxonomy
10.wp_usermeta
11.wp_users
1. wp_commentmeta
2. wp_comments
3. wp_links
4. wp_options
5. wp_postmeta
6. wp_posts
7. wp_terms
8. wp_term_relationships
9. wp_term_taxonomy
10.wp_usermeta
11.wp_users