Allowed memory size of

Fatal error: Allowed memory size
If you get “Fatal error: Allowed memory size of” when you are visiting customizer page, it means you need to increase memory limit for your WordPress website.

Go to your WordPress root directory and edit wp-config.php file.
Add next code to the top of page: define(‘WP_MEMORY_LIMIT’, ‘256M’);
After this above stated error should gone.

How to add Parallax in Safari or Firefox

CSS Parallax Working in Chrome, but Not Working in Safari or Firefox

 

The Solution:

#home_request {
   background-image: url(http://..........);
   background-size: cover;
   background-position: center;
   background-repeat: no-repeat;
   background-attachment: fixed;
   position: static;
   background-attachment: initial;
}

Expire the old posts

WordPress Plugin Post Expirator

How to create WordPress plugin Post Expirator. The post expire after 10 days

 

Copy the code below in functions.php
 

<?php
/*** Expire the old posts 10 days **/
function expire_post () {
global $wpdb;
$daystogo = "10";
$sql =
"DELETE FROM {$wpdb->posts}
WHERE DATEDIFF(NOW(), post_date) > %d AND
post_type = 'post' AND
(post_status = 'publish' OR post_status = 'pending' OR post_status = 'inherit')";
$wpdb->query($wpdb->prepare($sql, $daystogo));
}
add_action('wp_head', 'expire_post');
add_action('admin_head', 'expire_post');
?>

Plugins url issue

Function Reference – plugins url

Retrieves the absolute URL to the plugins or mu-plugins directory (without the trailing slash) or, when using the $path argument, to a specific file under that directory. You can either specify the $path argument as a hardcoded path relative to the plugins or mu-plugins directory, or conveniently pass __FILE__ as the second argument to make the $path relative to the parent directory of the current PHP script file.

 

Common Usage
The plugins_url() function is commonly used in a plugin file. Passing the __FILE__ PHP magic constant in the place of $plugin parameter makes the $path relative to the parent directory of that file:

 

 
Correctly:

<?php
echo '<img src="' . plugins_url( 'images/wordpress.png', __FILE__ ) . '" > ';
?>

 
Incorrectly:

<?php
echo '<img src="' . plugins_url( 'plugin-folder/images/wordpress.png') . '" > ';
?>

WordPress Template Files List

Template Files List

Here is the list of the Theme files recognized by WordPress. Of course, your Theme can contain any other stylesheets, images, or files. Just keep in mind that the following have special meaning to WordPress — see Template Hierarchy for more information.

style.css
The main stylesheet. This must be included with your Theme, and it must contain the information header for your Theme.
rtl.css
The rtl stylesheet. This will be included automatically if the website’s text direction is right-to-left. This can be generated using the RTLer plugin.
index.php
The main template. If your Theme provides its own templates, index.php must be present.
comments.php
The comments template.
front-page.php
The front page template.
home.php
The home page template, which is the front page by default. If you use a static front page this is the template for the page with the latest posts.
single.php
The single post template. Used when a single post is queried. For this and all other query templates, index.php is used if the query template is not present.
single-{post-type}.php
The single post template used when a single post from a custom post type is queried. For example, single-book.php would be used for displaying single posts from the custom post type named “book”. index.php is used if the query template for the custom post type is not present.
page.php
The page template. Used when an individual Page is queried.
category.php
The category template. Used when a category is queried.
tag.php
The tag template. Used when a tag is queried.
taxonomy.php
The term template. Used when a term in a custom taxonomy is queried.
author.php
The author template. Used when an author is queried.
date.php
The date/time template. Used when a date or time is queried. Year, month, day, hour, minute, second.
archive.php
The archive template. Used when a category, author, or date is queried. Note that this template will be overridden by category.php, author.php, and date.php for their respective query types.
search.php
The search results template. Used when a search is performed.
attachment.php
Attachment template. Used when viewing a single attachment.
image.php
Image attachment template. Used when viewing a single image attachment. If not present, attachment.php will be used.
404.php
The 404 Not Found template. Used when WordPress cannot find a post or page that matches the query.

WordPress 4.6 Release Candidate

The release candidate for WordPress 4.6 is now available.

We’ve made a few refinements since releasing Beta 4 a week ago. RC means we think we’re done, but with millions of users and thousands of plugins and themes, it’s possible we’ve missed something. We hope to ship WordPress 4.6 on Tuesday, August 16, but we need your help to get there.

If you haven’t tested 4.6 yet, now is the time!

Think you’ve found a bug? Please post to the Alpha/Beta support forum. If any known issues come up, you’ll be able to find them here.

To test WordPress 4.6, you can use the WordPress Beta Tester plugin or you can download the release candidate here (zip).

For more information about what’s new in version 4.6, check out the Beta 1, Beta 2, Beta 3, and Beta 4 blog posts.

Developers, please test your plugins and themes against WordPress 4.6 and update your plugin’s Tested up to version in the readme to 4.6. If you find compatibility problems please be sure to post to the support forums so we can figure those out before the final release – we never want to break things.

Be sure to read the in-depth field guide, a post with all the developer-focused changes that take place under the hood.

Do you speak a language other than English? Help us translate WordPress into more than 100 languages!

Happy testing!

Der Sommer ist da,
Zeit für ein neues Release.
Bald ist es soweit.

WordPress can’t upload new theme

The WordPress theme directory is used by millions of WordPress users all over the world. Themes in the directory are available for download from WordPress.org, and WordPress users can also install them directly from their administration screens.

Theme uploading is currently disabled.

From the first of July wp stopped possibility to upload of new themes. The reasons for this are not clear. Maybe WordPress create a new system reliable strategy for upload on the themes. The problem is fined. Currently can not update and new themes, which means that WP is stopped uploading themes and reviews.

How to create a WordPress theme?

1. Each theme for WordPress has its design. For this purpose we create two files. The first file is said index.html, and the second – style.css. The file that says index.html, presented the following code:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>WordPress Theme</title >
<link rel="stylesheet" type="text/css" media="all" href="style.css">
</head>
<body>
<header>
<h1>My First WordPress Theme</h1>
<p>SEO Title</p>
<div class="clr"></div>
<nav>
<ul>
<li>Menu 1</li>
<li>Menu 2</li>
<li>Menu 3</li>
<li>Menu 4</li>
<li>Menu 5</li>
<li>Menu 6</li>
</ul>
</nav>
<div class="clr"></div>
</header>
<div class="clr"></div>
<div id="main">
<section>
<article>
<h1>Article Title</h1>
Dynamic part
</article>
</section>
<aside>
<ul>
<li>Sidebar Content</li>
</ul>
</aside>
</div>
<div class="clr"></div>
<footer>
Copyright
</footer>
</body>
</html>

 

2. The second file that is absolutely essential, says style.css. In the code below you can familiarize yourself with the model content of the file style.css.

body {
color: #2b2b2b;
margin: 0 auto;
padding: 0;
max-width: 980px;
}
header {
border: 1px solid #ddd;
width: 100%;
height: 100%;
}
header h1 {
border: 1px solid #ddd;
max-width: 47%;
float: left;
padding:10px;
margin: 10px;
}
header p {
float: right;
border: 1px solid #ddd;
max-width: 47%;
padding: 10px;
margin: 10px;
}
nav {
border: 1px solid #ddd;
line-height: 40px;
max-width: 100%;
margin-top: 20px;
max-width: 980px;
}
nav ul {
border: 1px solid #ddd;
height: 40px;
padding:0;
margin: 0;
max-width: 980px;
}
nav ul li {
border: 1px solid #ddd;
list-style-type: none;
float: left;
line-height: 40px;
vertical-align: middle;
padding-left: 10px;
padding-right: 10px;
max-width: 100%;
}
nav ul li:hover {
background: red;
}
section {
border: 1px solid #ddd;
float: right;
width: 70%;
padding: 10px;
margin: 10px;
word-wrap:break-word;
}
#main {
border: 1px solid #ddd;
width: 100%;
height: 100%;
display: inline-block;
}
aside {
border: 1px solid #ddd;
float: left;
max-width: 19%;
padding: 10px;
margin: 10px;
word-wrap:break-word;
}
aside ul, aside li {
list-style-type: none;
margin:0;
padding: 0;
}
footer {
border: 1px solid #ddd;
text-align: center;
padding: 10px;
}
.clr {
clear: both;
padding: 0;
margin: 0;
width: 100%;
height: 0;
line-height: 0px;
font-size: 0px;
border: none;
}
@media screen and (max-width: 300px) {
nav, nav ul, nav li{
float: none;
min-width: 300px;
margin: 0 auto;
}
}
@media screen and (max-width: 800px) {
section{
float: none;
margin: 0 auto;
padding: 10px;
}
aside{
float: none;
min-width: 200px;
margin: 0 auto;
}
}
@media screen and (max-width: 980px) {
header p, header h1{
float: none;
min-width: 200px;
margin: 0 auto;
}
}

 

3.Both files and style.css index.html now form our sample page. Now we must create four new files – index.php, header.php, sidebar.php, footer.php. We will create and file functions.php. See five examples below.

File index.php

<?php get_header();?>
<div id="main">
<section>
<article>
<h1>Article Title</h1>
Content
</article>
</section>
<?php get_sidebar();?>
<?php get_footer();?>

File header.php

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>WordPress Theme</title >
<link rel="stylesheet" type="text/css" media="all" href="style.css" />
</head>
<body>
<header>
<h1>My First WordPress Theme</h1>
<p>SEO content</p>
<div class="clr"></div>
<nav>
<ul>
<li>Menu 1</li>
<li>Menu 2</li>
<li>Menu 3</li>
<li>Menu 4</li>
<li>Menu 5</li>
<li>Menu 6</li>
</ul>
</nav>
</header>
<div class="clr"></div>

File sidebar.php

<aside>
<ul>
<li>Sidebar Content</li>
</ul>
</aside>
</div>

File footer.php

<?php
/**
* The template for displaying the footer
*/
?>
<div class="clr"></div>
<footer>
Copyright
</footer>
</body>
</html>

File functions.php

It remains empty.

Then add the following code at the beginning of the file style.css, before everything else and put already changed style.css file in the folder with the other five files that we created earlier. With the code that you see below and we raised at the beginning of our style.css file, we asked ourselves the title of our theme. Also recorded information about the author, description of the theme and Internet address to the theme.

/*
Theme Name: WordPress Theme
Theme URI: http://wp-top.org/
Description: WordPress Theme
Author: wp-top.org
*/

Then we make another change in our file header.php, as a way to replace our css universal php function that uses WP. So automatically WP for us is the path to the file style.css. Here’s the code in header.php:

 

<?php bloginfo ('stylesheet_url');?>

Now your header.php file looks like this:

 

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title >WordPress Theme</title>
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo ('stylesheet_url');?>" />
</head>
<body>
<header>
<h1>My First WordPress Theme</h1>
<p>SEO Content</p>
<div class="clr"></div>
<nav>
<ul>
<li>Menu 1</li>
<li>Menu 2</li>
<li>Menu 3</li>
<li>Menu 4</li>
<li>Menu 5</li>
<li>Menu 6</li>
</ul>
</nav>
</header>
<div class="clr"></div>

Create a folder that named of our theme and contains currently in itself listed below files:

Folder

In header.php file put the following code in the head section of HTML5 document. We use the editor, which is located in WP and allows us to see the code of the pages and to change it.
Insert the code above the end of the head portion after all other elements
<?php wp_head(); ?>

We should be put in the same way the code below in our file footer.php, immediately before the tag body:

 

<?php wp_footer(); ?>

Function to start the dynamic part:

<?php
if(have_posts()):
while (have_posts()):
the_post();
?>

This marks the end of the dynamic part:

<?php
endwhile;
endif;
?>

To declare the title, h1 tag in place following php function:

<?php the_title(); ?>

To declare the content in the article tag remove excess information that we have introduced, and put the following php function:

<?php the_content();?>

Here are the aforementioned functions when placed already in your index.php:

 

<?php get_header();?>
<div id="main">
<section>
<?php if(have_posts()) : while (have_posts()) : the_post(); ?>
<article>
<h1><?php the_title(); ?></h1>
<?php the_content();?>
</article>
<?php endwhile; endif; ?>
</section>
<?php get_sidebar();?>
<?php get_footer();?>