Showing posts with label wordPress. Show all posts

How to Develop website using WordPress?

If you are planning to develop website, then WordPress comes as a better choice. Still wondering why WordPress? Have a look at Why WordPress?

To develop any website using WordPress following the steps given below:
  1. Design of the Website: The main thing that matters today is the design of the website. The appearance of the website is important in many aspects. First of all it helps to attract user attention. Secondly, good design website can be easily optimized in terms of code, layout, structure and pattern. But if you are not sure, which design is better for you, here are some to the points to keep in mind:
    •  Prototyping: See some of the website of the kinds you are trying to make. If you making website related to products in Amazon, try to hunt similar website available in the market. Then study them and try to find similarity between then. Once you come along with the design layout, structure them so that it is some how different from your competitor.
    • Consultant: There are lots of forums, blogs, chat centers that can help you decide best design for your website. Post your question, on them.
    • Choose Ready-made themes: There are hundreds of options on market. Try to see the demo of the themes. Try to find optimal design that suits for you. 
2.  Develop your website:  Here you keep track of the functionality of your website. Before you make your website live to the user, make sure, there are no broken links, make sure there are no broken images and make sure all the forms you have on the website are running.



Learn more »

What are the advantages of using WordPress?

1. Ease of Use

WordPress is very easy to use and has an intuitive interface.  Adding new pages, blog posts, images, etc. on a regular basis is a breeze and can be done quickly.  Because the technology is so simple, time spent on formatting is greatly reduced.

2. Manage Your Website from Any Computer

WordPress is browser-based. You can login from any Internet connected computer and manage your site.

3. No HTML Editing or FTP Software Required

WordPress is a self-contained system and does not require HTML editing software (such as Adobe Contribute or Dreamweaver). You can create a new page or blog post, format text, upload images (and edit them), upload documents, video files, image galleries, etc. all without the need for additional HTML or FTP software.

4. Search Engines Love WordPress Sites

The code behind WordPress is very clean and simple, making it easy for search engines to read and index a site’s content. In addition, each page, post, and image can have its own meta tag keywords, description, and title, and be optimized for specific keywords, allowing for very precise search engine optimization.  You can also use tags to further enhance your search engine optimization efforts.

5. You Have Control of Your Site

No more waiting for your web designer to make simple updates to your site. With WordPress, you have control of nearly every aspect of your site and can easily make those simple updates yourself.

6. The Design of Your Website is 100% Customizable

WordPress acts as the engine for your website. The look and feel of the site can be 100% customized so your brand can shine through on your site and provide a unique experience to your visitors.

7. A Blog is Built-in and Ready to Go

Since WordPress was originally created as a blogging platform, blogging capabilities are built-in and are easy to integrate, if desired. Setting up RSS / email subscriptions to your blog, commenting capabilities, and automatically adding the most recent blog posts to other pages of the site (your home page, for example) are also very simple to set-up, and help to extend your company’s reach and make your site more dynamic and interactive.

8. Extend the Functionality of Your Site with Plugins

Want to add an event calendar, video gallery, Twitter Feed, Facebook Fan Box, and more to your site? WordPress makes this possible with plugins, most of which are free or very reasonably priced.

9. Your Site Can Grow as Your Business Grows

WordPress sites are very scalable. You can have hundreds of thousands of pages or blog posts on your site and the performance of the site will not be compromised in the least.

10. Have Multiple Users

As an administrator of a WordPress site, you can set-up multiple users for the website and assign access levels and capabilities to each user.
Learn more »

Let a program is trying to assign the value 09875 to a variable but it keeps coming up with a different value; Do you know why it is happening?

 The error in the output is due to the fact that the interpreter declares a number as octal if it starts with 0.
Learn more »

Briefly explain the difference between accessing a class method via -> and via ::?

When we access a class method via -> we will require object initialization but when we choose :: we can access the methods which performs static operation.
Learn more »

What is the difference between starting a string with single quote and double quote? What you will use in general instance?

A data kept inside a single quoted string is not parsed for variable substitution where as when we initialize the string with double quote the data is parsed for variable substitution. If we don’t require variable substitution particularly then it is always preferred to use single quote as it is much speedy process.
Learn more »

What is the simplest way to find out the number of parameters passed into a function?

It is really easy to find out the no. of parameters passed into the function by following the below provided command:
func_num_args()
Learn more »

Briefly explain the procedure to pass a variable by value in WordPress?

Passing a variable by value in WordPress is similar to as that in C++. We have to just add an ampersand in front of the variable to do the task.
$X= &$Y
Learn more »

Can you give me a difference between characters 35 and x35?

These Both Characters are a way different from each other. The first character is defined as octal 35 whereas the second one is Hex x35.
Learn more »

Is WordPress good for Google ranking and SEO?

Yes! WordPress was born with one of key features to drive the traffic called built-in SEO and it is the most considered point along with other features in this technology, which makes it popular worldwide. Search engine optimization is considered the best selling point of WordPress to boost the traffic over the web or in other words Google ranking. Although there are multiple CMSs, but they require an installed SEO extension, whether commercial or free, but WordPress is SEO-ready. It can further extend the SEO feature via a few Nice FREE SEO plugins, including All in one SEO and Yoast. These well-known & popular plug-ins help you rank your website’s on multiple search engines like Google, Bing and Yahoo.
Learn more »

Can you override database values for your sit URLs in wp-config.php?

 Yes, overriding of database values is possible.
Learn more »

What is the limitation to the depth of your categories?

There is no limitation level to the depth.
Learn more »

Can you answer that whether objects are passed by value or by reference?

All the objects are passed by Value.
Learn more »

What is the procedure to call a constructor for a parent class?

The command to call a constructor for a parent class is
parent::constructor($value)
Learn more »

Do you think WordPress site is secured?

Yes! A WordPress Website is completely secure from any unauthorized access. However the error may occur due to downloading the Plug-in and Tools from an unauthorized resource.

Most of the attacked reported in WordPress site were due to plugin vulnerabilities, Hosting problem and weakness of the programmer. 
Learn more »

How many tables default WordPress have? Can you name those default WordPress table?

There are all together 11 tables by default. They are :
  • wp_options
  • wp_users
  • wp_links
  • wp_commentmeta
  • wp_term_relationships
  • wp_postmeta
  • wp_posts
  • wp_term_taxonomy
  • wp_usermeta
  • wp_terms
  • wp_comments
Learn more »

What is WordPress?


The WordPress web site defines WordPress as “web software you can use to create a beautiful website or blog. “ That describes it in the simplest form possible though I will try to expand on that. WordPress is the platform that we currently use for the majority of all client web sites. It was originally used for blogs but has since expanded to be used for full web sites, both personal and business. The main reason people prefer using WordPress now is that it is extremely easy to use, even for a beginner. Once the site is setup (that is where we come in) you will be able to update the content of your web site yourself, without having to know any programming at all! If you are able to create a document in Microsoft Word then you will be bale to update your web site, it is that easy.


WordPress also allows your site to be expanded with incredible features thanks to the many plugins available. We will determine at the start of the project what you will need and everything will be setup and customized for you. 
Learn more »

List some of the common WordPress URLs.

Following are the most common URLs that are found in WordPress:
  1. admin_url() - It returns the admin URL (http://www.site.com/wp-admin/)
  2. site_url() - It returns the URL of the site, (http://www.site.com/)
  3. home_url() - It returns the home url of the current site, (http://www.site.com/)
  4. includes_url - It returns the includes folder of WordPress folder - (http://www.site.com/wp-includes/)
  5. content_url - It returns the content directory URL - (http://www.site.com/wp-content/)
  6. wp_upload_dir() -It returns an array with location information on the configured uploads directory.
Learn more »

How to check if the logged in user is subscriber or not in WordPress?

Following codes can be used to check if the logged in user is subscriber or not.

<?php
global $current_user; // Use global
get_currentuserinfo(); // Make sure global is set, if not set it.
if ( ! user_can( $current_user, "subscriber" ) ) // Check user object has not got subscriber role
    echo 'User is a not Subscriber';
else
    echo 'User is a Subscriber';
?>
Learn more »

How to make new widget in Wordrpress? Explain with examples.

class My_Widget extends WP_Widget {
         public function __construct() {
               // widget actual processes
            parent::WP_Widget(false,'Tags by Category','Simple widget to extract tags by Category');
        }

        function form( $instance ) {
        $instance = wp_parse_args( (array) $instance, array( 'title' => '') );
        $title = $instance['title'];
?>
        <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></label></p>
<?php
    }

    function update( $new_instance, $old_instance ) {
        $instance = $old_instance;
        $new_instance = wp_parse_args((array) $new_instance, array( 'title' => ''));
        $instance['title'] = strip_tags($new_instance['title']);
        return $instance;
    }

        public function widget( $args, $instance ) {
               // outputs the content of the widget
            $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );

        echo $before_widget;
        if ( $title )
            echo "<h3 class='widget-title'>".$before_title . $title . $after_title."</h3>";
           
             query_posts('category_name=written-articles');
 if (have_posts()) : while (have_posts()) : the_post();
        $posttags = get_the_tags();
  if ($posttags) {
   foreach($posttags as $tag) {
    $all_tags_arr[] = $tag -> name; //USING JUST $tag MAKING $all_tags_arr A MULTI-DIMENSIONAL ARRAY, WHICH DOES WORK WITH array_unique
    $all_link[] = get_tag_link($tag->term_id);
   }
  }
 endwhile; endif;

 $tags_arr = array_unique($all_tags_arr); //REMOVES DUPLICATES
 $tags_link = array_unique($all_link);
 //echo '<pre>'.print_r($tags_arr, true).'</pre>'; //OUTPUT FINAL TAGS FROM CATEGORY
 //echo '<pre>'.print_r($tags_link, true).'</pre>';
echo '<div class="tagcloud">';
    for($i = 0; $i<count($tags_arr);$i++)
    {
        echo '<a href="'.$tags_link[$i].'">'.$tags_arr[$i].'</a>'." "; 
    }

        echo "</div>\n";
        }

}
register_widget( 'My_Widget' );
Learn more »

Top WordPress Question Answers

WordPress 3.1 test answer -

1. You want to schedule a backup of your site database but do not have enough permissions to access your host. Which of the following choices can help you perform this task?

b.  Install “wp database backup” plug-in.

2. Which of the following actions must be performed before upgrading WordPress?

f.   a, b, and c
3. Which of the following files must be deleted after installing WordPress?

d.   None of these files.
4. A possible way to install WordPress in your language is to _________________.

a.   manually install language package or translate as necessary

5. Which of the following actions must you perform to move your site from “/wordpress” to “/blog/wordpress”?

c. Update the database.

6 .On which of the following databases can WordPress be installed by default?

a.  MySQL

7. WordPress’s requirements are modest. At minimum, your server should support:

b. PHP version 4.3 or greater, MySQL version 4.0 or greater

8. Can you Override database values for your site URLs in wp-config.php?

a. Yes

9 .After moving a WordPress site to a new host. If you changed your site’s URL. Do you have to update your posts and pages to correct paths to your uploaded media files?

a.  Yes

10. Is it able to run more than one site/blog from a single installation of WordPress?

a. Yes

11. What is the first action you need to take for enabling WordPress MU feature?

c.  Add this code to wp-config.php file: define( ‘WP_ALLOW_MULTISITE’, true );

12. Which of the following actions must be performed before enabling the Network feature?

b.  Deactive your plugins

13. Is supper cache a built-in plugin of WordPress?

b.  No

14. After how many times did you enter an invalid password, your IP Address would be locked?

e.  no limit

15 .Super Cache compression can cause problems if your server is _______

c.  already compressing output using mod_deflate (on Apache) or PHP compression (zlib)

16. Can you choose your username during the installation process from which version?

c.    3.0

17. Can you move your wp-config.php file to the parent directory without changing any settings?

b.  Yes, provided that you are installing WordPress in your web root directory (such as public_html). Otherwise, it is imposible.

18 .Can you move your wp-content folder elsewhere or rename it to something else without changing any settings?

b.   No

19. A possible way to collect real-time statistics about traffic to a WordPress site is to:

b.use a plug-in

20 How can the use of html code in comments be disabled?

c.By changing the theme’s source code.

21.  The date/time format of a WordPress site can be changed in __________________.

b.admin settings

22 _________________ is a good way to improve the performance of a WordPress blog.

c.Installing the “wp super cache” plug-in

23. Which of the following blog sites can be imported into WordPress?
d.Opera

24.  Which of the following actions must be performed to import data from WordPress.com?

c.   Login wordpress.com, then export data by export tool, and import a exported xml file to your site.

25 Which of the following data can you import from Blogger site?

c.Posts, comments, and users

26. Can you import content from joomla or mambo site into wordpress?

a.Yes

27 Can you import content from static HTML files into wordpress?

a.Yes

28 Which of the following actions must be fixed after importing data into wordpress?

d.   All of above data

29.  How many built-in user roles does WordPress have?

4

Note: they are “Administrator”, “Editor”, “Author”, “Contributer” and “Subscriber”

30.  Can users change their avatar on profile setting panel?

b.No

31.  Can you add an extra fields to user’s profiles (as birth day, birth year,..)?

a. Yes

32.  ____________ can do anything in the WordPress administration area: write, edit, and delete posts, pages, links, and comments; upload media files of any type; import content; manage the Dashboard; create, edit, and delete other users; enable and configure plugins and themes; change the site’s theme; and manage all the available options.

Administrator

33 ____________ can publish, edit, and delete posts and pages written by any user. They can upload some kinds of files, and they can write HTML without restrictions. They can manage links and categories, and they can moderate comments. Editors and administrators are also the only users allowed to read private posts and pages.

Editor

34_____________ can publish, edit, and delete their own posts. They cannot write pages. They can upload some kinds of media files, and they are allowed to use only the limited set of HTML tags.

Author

35 ____________ can write their own posts but may not publish or delete them. Their HTML is limited to the set of allowed tags and they cannot upload media files.

Contributor

36 ____________ can manage their own profiles, but can do virtually nothing else in the administration

area.

37. User Level 0 converts to …

Subscriber

38. User Level 1 converts to …

a. Contributor

39.User Level 3 converts to …

Author

40.User Level 7 converts to …

Editor

41. User Level 10 converts to …

Administrator

42. Which of the following role levels has the highest privilege?

b.  Level_10

43 .Does author have the ability to create a category?

b.  No

44 . A possible way to allow the display of several authors’ names on one post is to ______

d. use a plug-i

45. Which of the following methods can be used to enable posting via e-mail?
b.  Configuring the feature in admin settings.

46.Image size limits can be set _______________.
c.  in the admin settings

47. A taxonomy is a _______

c. group of terms

48. in which version were custom taxonomies introduced?

a. 2.3

49. Which of the below functions is required to create a new taxonomy?

b. register_taxonomy

50.Which of the following methods is required to post html code for others to read?

a. Replacing special characters with corresponding html codes or character codes.

51.Can you set individual password for each post?

a.  Yes

52.Who of the following persons can read a post locked by password?

c.  Anyone who knows a password

53.What is the limitation to the depth of your categories?

c.  No limit levels

54

Can you set the same slug for two categories that have different parents?

b.  No

55

Can a post belong to more than one category?

a. Yes

56

Can you limit the number of revisions WordPress stores by _____

a.  adding the following line to your wp-config.php file: define(‘WP_POST_REVISIONS’, 3);

b. using a plugin

57

Are categories and tags not available for pages?

a.   Yes

58

Which of following action must be performed before using Akismet Plugin?

b. Create an account at wordpress.com.

59

Which of the following tasks should be performed before installing any widget?

c.   Verify that your WordPress theme is widget-ready.

60

In order to display a widget, the user must _________________.

b.  drag the desired widget to the side bar

61

To manually make the sidebar widget-ready, the user must ______________.

a.  modify the sidebar.php file

62

Which of the following methods can be used to eliminate spam?

e.   a and b

63

Which of the following tasks must be performed to add a favicon icon to your site?

e. a and b

64

How can a logo be placed on a WordPress header?

a.  Manually add the logo to the source code.

65

Which of the following theme files can be used to customize the “page not found error” error page?

b.  404.php

66

Is the functions.php file required in each theme?

b.   No

67

Which of the following files are required for completing your theme?

c.   Index.php and style.css

68

What is the name of theme file for a page with slug ‘about’?

b. page-about.php

69

What is the name of theme file for a page with id ‘3’?

b.  page-3.php

70

‘Slug’ is higher priority in use than ‘id’ in Template Hierarchy?

a.  Yes

71

Can you create a specific theme file for a custom content type?

a. Yes

72

What is the right order (by priority in use) to display page in Template Hierarchy?

a. page-{slug}.php, page-{id}.php, page.php, index.php

73

What is the right order (by priority in use) to display category in Template Hierarchy?

c. category -{slug}.php, category-{id}.php, category.php, archive.php, index.php

74

What is the right order (by priority in use) to display tag in Template Hierarchy?

c. tag -{slug}.php, tag -{id}.php, tag.php, archive.php, index.php

75

What is the right order (by priority in use) to display taxonomies in Template Hierarchy?

b. taxonomy -{taxonomy}-{term}.php, taxonomy-{taxonomy}.php, taxonomy.php, archive.php, index.php

76

Where can Google Adsense be integrated into a WordPress blog?

c. Anywhere.

77

One way to get posts from a specific day is to ____________________.

b.  use the query_posts loop in the source code

78

The “function_exists()” function can be used to check whether a plug-in is activated or not.

a.  True

79

Conditional tags can be used to _______________________.

c.  change the content to be displayed

80

The WordPress loop can be used ____________________.

b.  to display every post

81

Using ____________is a good way to ensure that a WordPress site is indexed by search engines.
a.  a sitemap

82

Which of the following statements regarding permalinks on a WordPress site is true?

b.  Permalinks are optional but highly recommended.

83

In which of the following ways can a redirect feature be added to a permalink?

e. a and b

84

One way to make a WordPress page title more SEO friendly is to ____________.

c.  change the title tag in header.php to something like “blog name »» category »» post name”

85

Meta tags can be added to WordPress pages by ________________.
a.   using plug-ins

b.  adding them to the header.php file

86

Which of the following methods can be used to make permalinks SEO friendly?

d  Configuring the feature in the admin settings.

87. contributor roles are

Learn more »