How to Find WordPress Page and Post IDs

How to Find WordPress Page and Post IDs

WordPress page or post IDs can be used for various WordPress plugins and services that need an appropriate ID structure to operate. A simple way to find your WordPress page or post ID is to visit the specific page or post in your WordPress administration dashboard and observe the URL in your internet browser’s address bar.

  • Our post ID in the picture below is: 6089 because the URL says post=6089

Find WordPress Post Page ID

How to display recent posts on WordPress pages

How to display recent posts on WordPress pages

There are many ways to display recent posts on WordPress pages without using bulky plugins and default features that cause headaches and slow down your website. There are also different options you can use to embed certain WordPress posts. For example, you can display recent posts in a list, display recent posts in a drop-down menu, and you can even display all WordPress posts if you wish to.

The PHP codes below can be added into your WordPress template pages and files in order to display recent WordPress posts on certain pages.

Display recent posts in a list

<?php get_archives('postbypost', '30', 'custom', '', '<br />'); ?>

The above PHP snippet will allow you to display 30 recent posts. To change the amount of recent posts to display, simply change the 30 to any number.

Display recent posts per day(s)

<?php wp_get_archives('type=daily&limit=15'); ?>

The above PHP snippet can be used to display the most recent WordPress posts from the last 15 days. To change the amount of days pulled, switch the 15 above with any numeric.

Display recent posts per month(s)

<?php wp_get_archives('type=monthly&limit=12'); ?>

The above PHP snippet can be used to display the most recent WordPress posts from the last 12 months (1 year). To change the amount of  months, switch the 12 above with any numeric.

Display recent syndication feeds

if ( isset ( $query->query_vars['feed'] ) and ( $query->query_vars['feed'] == 'ics' ) )
{
	add_filter( 'post_limits', '__return_empty' );
}

The “Syndication feeds show the most recent” or ‘posts_per_rss‘ parameters in Settings > Reading will overwrite any ‘posts_per_page‘ parameter in a query used in a feed. Read More.

Display recent posts in a drop-down list

<form id="archiveform" action="">
<select name="archive_chrono" onchange="window.location =
(document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);">
<option value=''>Select Month</option>
<?php get_archives('monthly','','option'); ?>
</select>
</form>

Use this to display a drop-box menu of your monthly archives with post counts displayed.

You also can use the piece of code below instead to show month lists, including the number of posts/month.

 <select name="archivemenu" onChange="document.location.href=this.options[this.selectedIndex].value;">
 <option value="">Select month</option>
 <?php get_archives('monthly',,'option',,,'TRUE'); ?>
 </select>

Display all WordPress posts alphabetically

<?php wp_get_archives('type=alpha'); ?>

Display all your WordPress posts alphabetically. Sure it’s not essentially display “recent” posts but is an alternative.

How to create a WordPress Archive page

How to create a WordPress Archive page

Easiest way to create a WordPress archive page. There are tons of easy ways to create an exciting WordPress archives page. There are also tons of WordPress tutorials floating around the internet that offer minimal guidelines in doing so for those whom have not been introduced to making proper WordPress page templates. So this article will explain how to create a WordPress archive page that you can use as a page template.

How to block access to wp-admin page

How to block access to wp-admin page

Securing your WordPress login page, or your wp-admin folder, on your WordPress website by blocking outside access to the wp-admin page is very simple. You can take advantage of your website’s hypertext access file located at the root of the WP install and use a specific code to block access your wp-admin age to outside IP address of your choosing. Blocking access to your wp-admin page will help you website become less vulnerable to malicious brute force attacks and unwanted logins.

1. Copy and paste the code below into your .htaccess file.

order deny,allow
deny from all
allow from 000.000.000.000

2. Change 000.000.000.000 to your IP address: [user_ip]

This will allow your IP address exclusive access to the wp-admin folder and will restrict access to all other IP addresses. You can also add an IP range to the code.

To test this, try accessing your WordPress website’s wp-admin login page from another IP address. A suggestion would be to use a free proxy site such as proxyfy.com.

How to enable and use shortcodes in WordPress widgets

How to enable and use shortcodes in WordPress widgets

How to enable and use shortcodes in WordPress widgets using a PHP code. The code on this webpage will allow you to use shortcodes inside WordPress widgets. It works just like default widgets that utilize the do_shortcode function.

WordPress shortcodes were created to be used as a shortcut;  Therefor, by default shortcodes do not translate when placed into the WordPress text widget or other widget that allows you to input text. Furthermore, most WordPress themes do not include the function that allows you to the use of shortcodes inside WordPress widgets. However, if you use this code you will be able to use the shortcodes programmed by your theme inside your widget areas.

Copy and paste the PHP code below into your current theme’s functions.php file and click Update.

add_filter('widget_text''do_shortcode');

The best bbPress shortcodes for WordPress

The best bbPress shortcodes for WordPress

This is a list of the best bbPress shortcodes for WordPress websites. Default bbPress shortcodes can be used to create macros that are used in the layout of the forum content of your WordPress pages. The shortcodes can be inserted into any WordPress page, including widget spaces and PHP/template files.

 How to use BBPress Shortcodes

To use a BBPress Shortcode, simply copy and paste (insert) the code into your desired WordPress page and remove the space between [ and bbp  in the code.

BBPress Shortcode Example

bbPress account shortcodes

bbPress account shortcodes are used to easily display the login, register, and password reset forms.

If your WordPress theme does not have additional bbPress template pages, these shortcodes can be used to create separate pages, such as a login page.

Login form

[ bbp-login]

Register form

[ bbp-register]

Password reset form

[ bbp-lost-pass]

bbPress forums shortcodes

bbPress forums shortcodes can be used to display your bbPress forum on your WordPress website. You can display a “New Forum” form and display single forum topics.

These forum shortcodes are great for creating a forum index (aside from the existing BBPress forums page ) if needed and work well when establishing internal links between article/post and forum content.

Show all bbPress forums

[ bbp-forum-index]

New Forum form

[ bbp-forum-form]

How to display single forums

[ bbp-single-forum id=$forum_id=1234]

To display single bbPress forums (not single topics) replace 1234 in the shortcode above with your forum ID.

bbPress topic shortcodes

The shortcodes below will allow you to add forum topics to a WordPress page or create a topic page (index) if needed, as well as display the “New Topic” form, and single topics. Included are also shortcodes to display bbPress topic tag clouds.

 Topic index (15 most recent bbPress topics)

[ bbp-topic-index]

New Topic form

[ bbp-topic-form]

How to display single topics

[ bbp-single-topic id=$topic_id=5678]

To display single bbPress forum topics (not single forums) replace 5678 in the Sshortcode above with your bbPress topic ID.

Topic tag cloud

[ bbp-topic-tags]

How to display a list of bbPress topics with the same tag

[ bbp-single-tag id=$tag_id=91011]

To display a list for a single bbPress topic tag replace 91011 in the shortcode above with your bbPress topic ID.

How to fix “ERROR: Your topic cannot be created at this time” bbPress

How to fix “ERROR: Your topic cannot be created at this time” bbPress

ERROR: Your topic cannot be created at this time is a bbPress error message that occurs when the user is restricted from creating a topic. The ERROR: Your topic cannot be created at this time message in bbpress can occur for different reasons:

ERROR: Your topic cannot be created at this time

1. A WordPress spam plugin is enabled and blocked the user from publishing a blacklisted word

If you use a WordPress forum spam plugin or plugin that blocks comments based on certain trigger words your plugin may have caused the error message to occur. In order to fix the ERROR: Your topic cannot be created at this time message you will need to examine your plugins settings in order to determine what triggered the error message and remove the trigger if it is necessary.

2. The user attempted to publish a word that has been added to the Comment Blacklist

wordpress comment blacklist

The WordPress Comment Blacklist is located in the Settings > Discussion page. The blacklist will block certain words inputted into the blacklist. If you use this blacklist it may have caused the error message to occur. If this is the case you will need to examine your plugins settings in order to determine what triggered the error message and remove the trigger if it is necessary.

Also See: The best bbpress shortcodes

How to disable the WordPress Admin Bar

How to disable the WordPress Admin Bar

The WordPress admin bar is the gray bar located at the top of your WordPress website. The WordPress admin bar includes various options and quick access to your WordPress dashboard or webpage.

Some WordPress users may want to disable or hide the WordPress admin bar so we have compiled a list of six different ways to do so. The options include CSS and PHP snippets, as well as using a WordPress plugin or the built in feature to disable the admin bar for specific users.

1. The first option includes copying and pasting the css snippet below and inserting it into your custom.css file or your primary css style sheet.

Enter this code into your current theme’s custom.css or style.css file to disable the admin bar:

#wpadminbar { display:none !important;}

2. The second option includes copying and pasting the php snippet below and inserting it into your functions.php file.

Enter this code into your current theme’s functions.php file to disable the admin bar:

function hide_admin_bar(){ return false; }
add_filter( 'show_admin_bar', 'hide_admin_bar' );

3. The third option includes copying and pasting the php snippet below and inserting it into your functions.php file.

Enter this code into your current theme’s functions.php file to disable the admin bar:

add_filter( 'show_admin_bar', '__return_false' );

4. The fourth option makes the WordPress admin bar only visible to your Admin accounts.

Enter this code into your current theme’s functions.php file:

if (!current_user_can('manage_options')) {
add_filter('show_admin_bar', '__return_false');
}

5. The fifth option includes installing the free “disable admin bar” WordPress plugin.

Follow the link below for the WordPress plugin directory page:

6. The sixth option is standard in WordPress and will hide the toolbar when viewing your website.

Access a WordPress user profile you would like to disable the admin bar for and un-check Show Toolbar when viewing site.

WordPress Show toolbar option

How to generate website screenshots for WordPress websites

How to generate website screenshots for WordPress websites

This guide will help you easily generate a screenshot of a website for your WordPress website by implementing PHP code into the functions.php template file and using a WordPress shortcode. This script uses the WordPress.com screenshot generator and all you need to do is copy and paste simple code into your functions.php file and place a simple shortcode on a page or post on your WordPress website.