Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Updated Sunday, February 22nd, 2009 at 8:20pm

Show the Intro to Password Protected Posts in WordPress

This is a small hack for WordPress that allows you to show the first part of password protected posts. It will display the content you have before the ‘more’ tag, followed by the standard password box. I wrote this up for a member of the WordPress forum, and I thought I would share it here. Update: Instructions are now provided for WordPress 2.2

Before you begin

The instructions below have been verified in WordPress versions 2.0 through 2.8. The only difference between these versions is the file you have to edit.

Instructions

For WordPress 2.0 or 2.1, open /wp-includes/template-functions-post.php

For WordPress 2.2 through 2.8+, open /wp-includes/post-template.php

Find the following text:

$output = get_the_password_form();
return $output;

Replace it with this:

$content = $pages[$page-1];
$content = explode('<!--more-->', $content, 2);
$output = "";
$output .= $content[0];
$output .= get_the_password_form();
return $output;

This next step is optional, but I think it makes it nicer.

In the get_the_password_form function, find the following text (may vary between versions):

This post is password protected.

And replace it with this:

The rest of this post is password protected.

Or whatever text you would like it to show.

  If you have found this page useful, please consider donating. Thanks!

Pages: [6] 5 4 3 2 1 » Show All

  1. Ah well your comment! I did you good!VBDE

  2. I think that places like Facebook, i.e., the social networks that demand a transparent ‘self’ associated with the offline identity, Handbags

  3. Ad oggi uno dei marchi più grandi del mondo della moda, pelletteria Gucci è avviato, che sfruttano quando Gucci è stata fondata nel 1921,Handbags

  4. E qui viene il Moncler Piumini , i piumini che sono fatti da prima classe verso il basso che fornisce leggero e caldo allo stesso tempo. Moncler Giubbotto sono stati approvati da parte del mercato che sono le giacche più adatto per inverni freddi e l’abbigliamento invernale che ti fanno distintivo. 2011 Moncler Vendita La varietà di stoffe sicuramente incontrare personaggi speciali dei clienti ‘.

  5. I always thought he was well. But sometimes that is so, people do not know how to do. . Do you think? ?

  6. accessories no less color in clothing, bicycle chain is the most exciting theme pearl necklace and bracelet. Full of childlike, and Magnificent.

  7. I wonder whether the me-cult is able to reconcile itself with the thought that it might not always be in the right, and that ‘they’ might have a role in helping form their ideas.

  8. I think that places like Facebook, i.e., the social networks that demand a transparent ‘self’ associated with the offline identity,

  9. Ad oggi uno dei marchi più grandi del mondo della moda, pelletteria Gucci è avviato, che sfruttano quando Gucci è stata fondata nel 1921,

  10. Accessori da uomo tendenza, corrispondono alla moda perfetta per piccoli dettagli della transazione con un design semplice

  11. Ad oggi uno dei marchi più grandi del mondo della moda, pelletteria Gucci è avviato, che sfruttano quando Gucci è stata fondata nel 1921, un prodotto importante. Per celebrare il 90 ° anniversario di Gucci deliberatamente emessi chiamato “gucci 2011“, serie di nuovi modelli di lusso per uomo e donna. Questi sono in edizione limitata: l’utilità di queste Gucci Borse a mano di bambù o di coccodrillo, grande arco colori dal marrone scuro, rosso ciliegia al verde scuro. Gucci (Gucci) 2011 e le tendenze autunno inverno Baoxie semplici ed eleganti nella forma e nel design, con un tono seppia low-key di lusso.Economico Scarpe Gucci Accessori da uomo tendenza, corrispondono alla moda perfetta per piccoli dettagli della transazione con un design semplice …

  12. Ouyang Kun said that Coach in US

  13. can help me .thanks

Pages: [6] 5 4 3 2 1 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.