The post Hover Effect Style 274 appeared first on Best jQuery.
by Admin via Best jQuery
"Mr Branding" is a blog based on RSS for everything related to website branding and website design, it collects its posts from many sites in order to facilitate the updating to the latest technology.
To suggest any source, please contact me: Taha.baba@consultant.com
Just where does WordPress store your pages and posts, and how does it access them?
Pages and posts are stored in the WordPress database. This is an essential part of how your WordPress site works. Without it, none of your pages or posts would be saved and they wouldn’t be displayed when someone visits them.
In this post, I’ll show you how the database in WordPress works and how WordPress builds a page from the database when a visitor comes to your site.
WordPress is a content management system (or CMS). This means that instead of creating a static HTML file for each page in your site, it uses a database to store all the content of those pages, and then uses code to access that content each time a page is loaded.
As well as the database, WordPress consists of two more elements:
WordPress uses all these to build the pages in your site without you having to write any code.
So let’s take more of a look at where your pages and posts are stored and how the database is structured.
All of the content in your site is stored in the database. This includes:
alt text and a description, and information on which pages or posts art might be attached to.There are twelve tables in the WordPress database, which you can see in this image from the WordPress Codex.

Most of the tables are linked to each other, with wp_posts being the most important one:
The relationships between the tables link all of the data and ensures that for a given post, WordPress knows what taxonomy terms it has, who wrote it, what comments it has and more.
Two tables aren’t linked to the others and don’t have a relationship to your posts:
So your posts and pages are stored in wp_posts but metadata about them is stored in other tables which are linked to them.
But how does WordPress translate all this data into pages on your site?
WordPress uses a specific piece of code called The Loop to fetch database content and output it in the pages of your site. This applies for single pages, archive pages, the home page and search results.
Watch out this short video to get a complete introduction to the loop.
The loop starts with this code:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
This checks if there are any posts to be output on this page then while there are posts, uses the_post() template tag so that the posts’ content can be output.
Note that here, post doesn’t mean a blog post. A post in this context can mean any content type including a post, page, attachment or post of a custom post type. It can get confusing!
It ends with this code:
<?php endwhile; endif; ?>
This ends the while loop from the beginning, meaning WordPress stops looping through posts when it’s found everything it needs for this page in the site. It then closes the if check and stops checking if there are any posts.
In between those two lines will be the code that outputs content. I’ll show you different versions of this for different content types shortly.
WordPress knows what content is relevant for the current page based on the kind of page that’s being visited. So for an archive page it will know what kind of archive page it is (a category archive, for example), and for a single post or page it will know which post or page is being output. It will use the correct template file from the theme (using the theme hierarchy) to output the relevant loop for the current content type.
Let’s take a look at this in action.
The loop for single posts and pages will only be run once, because only the content for one post or page needs to be shown. WordPress knows this because it knows what kind of page it’s showing in your site and will only fetch the current post or page.
The loop for a single post will look something like this:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1 class="entry-title"><?php the_title(); ?></h1>
<section class="entry-meta">
<?php the_date(); ?>
</section><!-- .entry-meta -->
<section class="entry-content">
<?php the_content(); ?>
</section><!-- .entry-content -->
</article><!-- #post-## -->
<?php endwhile; endif; // end of the loop. ?>
This is a simplified version of the loop. In most themes it will also include more metadata, a list of categories, and comments. But it shows you how the core content of the post or page is output.
Everything is enclosed in an article element with an ID of the post ID and classes that are set using the post_class() template tag. There’s then a h1 element with the post title and a section for the content using the the_content() template tag.
All this is done automatically by accessing the database, meaning there’s only one file for all your single posts—the template file.
A loop for a page will look very similar and is less likely to have metadata and comments, but that will vary according to your theme.
Archive pages also use the loop but instead of outputting just one post, they will fetch multiple posts and display them all. So for example a category archive will output all posts in that category.
Again, WordPress knows to do this based on the page that’s being displayed. This is where the while() part of the loop is more obvious because WordPress will keep going through the loop again and again while there are posts to display.
Here’s an example loop for a category archive:
<?php if( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h3 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'compass' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<?php if ( has_post_thumbnail() ) { ?>
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail( 'medium', array(
'class' => 'left',
'alt' => get_the_title()
) );
?>
</a>
<?php } ?>
<section class="entry-meta">
<?php the_date(); ?>
</section><!-- .entry-meta -->
<section class="entry-summary">
<?php the_excerpt(); ?>
</section><!-- .entry-content -->
</article>
<?php endwhile; endif; ?>
There are a few key differences here compared to the single post or page:
h3 tag, not h2. This is because the title of the archive page will be in a h2 tag.the_permalink(). This means that a visitor can click through to the individual post from the archive page.There are differences, but as you can see, archives are using the loop just like single pages and posts—and they’re using it to access the database, fetch the content saved in the wp_posts table and output that.
The way the home page is displayed will depend on how you’ve set it up. Your home page can either be a list of your most recent posts, or it can be a static page. You can configure this in the Settings menu in the WordPress admin.
If your home page is a static page, then it will normally use the same template file as the other static pages in your site and the same version of the loop. This is unless your theme has a specific template file for the home page. Sometimes a template file like this will be used to fetch he contents of the page and output extra content such as a slider which is only on the home page. Either way, the loop will be like the loop we saw above for single pages.
If your home page is an archive of your latest posts, it won’t use the archive.php template file (annoyingly), but instead will use a template file specifically for the home page or, if there isn’t one, it will use the index.php file, which is the catch-all template file for any pages that don’t have a more specific template file.
It’ll work through the loop again and again, fetching and outputting probably the most recent posts in your site and showing either the excerpt or the full content. This depends on the code in your loop.
So whichever way your home page is set up, it’ll still be using the loop to access the database and fetch either the single stain page or the list of recent posts.
WordPress’s power comes from the fact that it’s a content management system. This means that to create a website, you don’t have to write any code. Instead, you create posts and pages in the WordPress admin screens and WordPress saves those to the database so they can be output on the relevant pages of your site so people can visit them.
This makes it much easier for you to create and manage your site and for the site to grow to include as much content as you need. Be sure to check out our learning guide if you want to learn more WordPress development.
Explore thousands of the best WordPress themes ever created on ThemeForest and leading WordPress plugins on CodeCanyon. Purchase these high-quality WordPress themes and plugins and improve your website experience for you and your visitors.

Here are a few of the best-selling and up-and-coming WordPress themes and plugins available for 2020.
Want to partner with influencers and brands to create content on Instagram? Wondering how to best manage and assess your influencer marketing campaigns on Instagram? In this article, you’ll learn the difference between branded content and sponsored posts, how to manage and analyze the partnerships with brands or creators you work with, and how to […]
The post How to Tag and Manage Instagram Branded Content appeared first on Social Media Examiner | Social Media Marketing.
