Pages

Thursday, 11 December 2014

How to add banners above or below all posts or pages

To add banners above or below all your posts or pages, you need to add the banner code inside the single.php or page.php files of your WordPress themes. Both files have similar content but they handle different parts of your site - your posts (single.php) and your pages (page.php). You can edit those files by single.php, page.php or you can also edit these files by logging to your WordPress admin area and going to Appearance -> Editor.

If you want to add the banner above your posts and pages, locate the following code:
<?php

 // Start the Loop.

 while ( have_posts() ) : the_post();?>
 
Right after it add the code of your banner. This will add your banner above the all of your page and post titles. Of course, you can add CSS styling in order to make it look according to your needs.like this:
<div class="entry-content"><a href="<?php echo site_url(); ?>/wp-content/uploads/2014/12/cropped-Precious-Pets-1038x239.gif"><img src="<?php echo site_url(); ?>/wp-content/uploads/2014/12/cropped-Precious-Pets-1038x239.gif"/></a></div>

How to add banners into a single post or page

If you want to add a banner into the body of your post or page, simply open the Text mode of the WordPress editor and paste the banner code in it.

This will add the image between the two sample paragraphs of this post. You can use the WordPress WYSIWYG editor in order to reposition or align this banner in order to make it look with the rest of your post or page.

How to write php code in your post,page or text widgets

1- for write code in your wordpress posts you need to downlode and install the following plugin.
 https://wordpress.org/plugins/php-code-for-posts/
2- After that open the plugin from wordpress dashbord.
3-Add new button
 for Example wordpress base url.
fill the field like
Change your code's name= Base url
Change the short description=Base url
about your code

Remember to open your PHP code with <?php= <?php
echo site_url();
?>

4- click the button update this code.
5- you will gat a short code like this "[php snippet=1]".
6- use this shortcut code where you want your php code in post,page or text widgets


Increasing the WordPress Memory Limit

1- Go to your root folder.
2- Open the wp-settings.php.
3- Add the the following code.
/** Memory Limit */
define('WP_MEMORY_LIMIT', '64M');//

Wednesday, 10 December 2014

FTP credentials on localhost ( Letting WordPress users install themes, plugins without FTP credentials)

1-Just Go To your wordpress root folder.

2- open wp-config.php.

3-Add this code to your wp-config.php file.
define('FS_METHOD','direct');
4- All Done Refresh Your Page and update anything.

Tuesday, 9 December 2014

Disable Comments Sitewide


WordPress is one of the most popular blogging framework that is used by many different sites. Commenting is often an essential part of blogs and is a feature that is built into the WordPress framework. But many a times you might want to disable comments on a blog post, a page or the entire site. There could be any number of varied reasons for this…
  • Old Posts: Posts are pretty old and are not relevant any more. You want to reduce the workload and monitor only comments on the latest posts.
  • Controversial or Irrelevant Comments: Sometimes the comments can get really out of hand, because of spamming or relevancy.
  • Spam Overload: Prevent spamming on your older posts that are not really active.
Whatever the reason, the process or steps to disable comments is mostly well documented in WordPress.

Disable Comments Sitewide

You can disable all the comments across the site by default, such that no comments can be posted to any of your new content.
  1. Go into the WordPress Administration UI (Ex: http://website/blog/wp-admin)
  2. Click on Settings
  3. Click on Discussion to open the Discussion Settings panel
  4. Under Default Article Settings, Uncheck the option Allow people to post comments on new articles
  5. Optionally, you can uncheck all the options under Other Comment Settings section
  6. Scroll down and click Save Changes to save settings
 
This will disable commenting on all the new content that will be posting. If you already have a site where comments were allowed, then you will need to disable commenting on each of those existing posts separately.

Disable Comments on all or multiple posts

If you need to disable comments on multiple posts on the website, then going into each and every post one after the other is probably not a very efficient method.

  1. In the Admin UI, click on Posts and then click on All Posts
  2. Select all the posts that you want to disable the comments
  3. Pull down the drop down menu that says Bulk Actions and select Edit
  4. Click Apply
  5. A set of options are shown that includes Comments and Pings
  6. Select the Do not Allow option from the dropdown for Comments
  7. Optionally, also select the Do not Allow option for Pings
  8. Click Update button to save the settings


 

Disable Comments on a post

Sometimes you just want to disable comments on a single post or you want the ability to disable comments on a post when you publish it. Turning off comments by default may not be an option.
  1. Go into Edit mode for the post that you want to change the option
  2. Scroll down towards the bottom of the edit page to find a section/module called Discussion
  3. Expand the module by clicking on it
  4. Uncheck the option Allow Comments
  5. Optionally, also uncheck the option to Allow trackbacks and pingbacks
  6. Scroll back up and click on Update button in the Publish module to save the settings
In case, you do not find the Discussion module (it is different from the Comments module, yeah…it is confusing), it might be disabled in the screen options.
  1. Click on Screen Options in the upper right hand corner of the edit page
  2. This will drop down to expose several options to configure the screen layout
  3. Make sure that the option Discussion is selected and has a check box next to it.
Depending on the theme that is used, if you cannot find the option to turn off comments in the Edit interface also check the Quick Edit interface to see if it can be turned off from there.