• To the wise sages of WP,

    I’d like to be able to add a quick tag to the body of all my posts at any point so that the text between the open and close sections display only on non-permalink pages (index.php/category.php) whilst the permalink page (single.php) displays as normal.

    For example I have a single post here regarding visits to a charity funded school. The school visit is displayed on single-x.php and a caption, that is selected from the post’s content, is displayed in place of ‘the_content’ function on index.php and/or category.php.

    To explain further:

    Single.php contains a report of a visit to school-10. The school category page displays a synopsis of the school visit but it is a *custom selection* taken from some point in the body of the post.

    “this is a report of school 10… here we have lots of writing…<show caption> These lines of text will be shown on the non-permalink pages for this post…..<end show caption>…. some more writing before the report ends.

    In this case the_excerpt or any number of x words at the start of a post don’t often suit my purpose when it comes to describing it. I’ve looked at the_excerpt(reloaded) plugin, coffee-to-code’s ‘hide and cut’ plugin and an interesting node at https://www.ads-software.com/support/topic/6121 but no luck.

    Can anyone suggest a way to do this? The school ‘synopsis’ page is given here.

    Kind Regards,
    Steve

Viewing 9 replies - 1 through 9 (of 9 total)
  • Why not just use the_excerpt by filling in the “Optional Excerpt” field when you write a post? That way, you can determine exactly what text appears.
    https://codex.www.ads-software.com/Template_Tags/the_excerpt

    Thread Starter rideforver

    (@rideforver)

    Wow that was quick! I agree. However, due to the project I am running, I can only email posts to my WP account from a Satphone in the field, and given the limited state of options available with the email plugin, (‘Postie’ being the best), this would seem to be the easiest way.

    If their *is* a way to email a post to WP and somehow enable the optional_excerpt feature I would be very interested to know.

    So you can’t create a post that will allow you to type in the regular post box and the “Optional Excerpt”? In other words, when you use the Satphone, you can’t email a post and an excerpt?

    That’s a good idea, though. A quicktag that would take all the content within, say, <!-- open excerpt --> and <!-- close excerpt --> and show that on the home page. This would be kind of like the more quicktag, but with a specified beginning and end. That way you could just worry about writing your entry and then decide which snippet of it will end up on the home page. Still, the optional excerpt field gives you the most control over this.

    Thread Starter rideforver

    (@rideforver)

    Correct. Due to the cost of physically accessing my wp-admin page over the sat-network I won’t be able to. The cost scales to $/minute!! The solution to that problem is using a service like outlook and some nifty email compression software…. anyhow i digress.

    I envisage, setting up my WP account to receive email posts, using Postie that can saught the post into the right category and use the subject as the title. Photos can be attached and the formatting then managed using html and css.

    From digging into the wP codex and Googling this issue over the past two weeks, it seems logical that a quicktag could be produced that displays the information/caption/excerpt (call it what you will) from anywhere within the post’s content. One could then select *any* peice of writing(s) and format it as they needed… for use on a non-permalink page. Being restricted to the top x words of a post in a ‘teaser’ has always frustrated me anyway.

    Alternatively, after that rant :), if an optional excerpt can be emailed separately as an attached text file and ‘included’ on the respective non-permalink page this could be a workaround, but isn’t clean or tight.
    An example of the above school ‘synopsis’ page in html format is https://www.r4e.org/wp-trial/School_reports_new_A%20CAT%20SCH.htm.

    Well, it’s perfectly possible to do extremely complex quicktags. I just did a bunch of pretty complicated table inputs for a financial whiz. What I’m wondering (having never done this with a cell phone, and not ever planning to) is what you’re seeing when you do this? Do you actually see the write post screen with the quicktag buttons? Or when you say “quicktags” are you just meaning the sort of commented input like <--more-->?

    In other words, I’m not quite getting this….

    Thread Starter rideforver

    (@rideforver)

    Hi Vkaryl. In the field, it’s a case of a satphone-modem and a laptop. Using an email client on the laptop, a compressed email (or ‘post-data’) is sent to WP, which then inputs the information into the template for formatting. It’s not like I can’t call up the WP admin UI using my laptop, it’s just damn expensive ?? I’m out and about for ten months and ‘blind’ email posting to WP will be the only way to go.

    When I say quicktags I do refer to the <–more–>/<–nextpage–> variety. I’ve refered to these as the logical way to insert into the email/post so that WP can then recognise them and give the desired output on non-permalink pages.

    Virtually everything in WP has to be automated to achieve the results I need, and having customizable ‘exerpts’ is a strong requirement in this case.

    Ah. Thanks for the explanation. Hmm. I don’t know if you can make more of those or not, or how complicated they could be if you could make more of them….

    Thread Starter rideforver

    (@rideforver)

    Coffee to code has a great plugin that adds ‘cut’ and ‘hide’ quicktags to a post that display ‘cut’ information on a non-permalink page from any point in the text of a post. Trouble is, that same ‘cut’ data is then missing from the permalink page when the user visits. Is there a way around this method?

    Alternatively to start firing with ideas, could a plugin take the data from between specified tags and input it into a table under that post’s id. Then when the non-permalink page loads, a function replacement for the_content() for that post calls the ‘excerpt’ and displays it with a link.

    I would really love to make this work. Not only would this be useful on the above school visit examples but also on latest posts where the first paragraphs of a post don’t necessarily match the teaser you want to create. Thanks again.

    Thread Starter rideforver

    (@rideforver)

    One work around I’ve managed is to write your customizable piece of information at the very start of your post, and then use the <–show–><–/show–> attributes of Coffee to Code’s Hide and Cut plugin followed by the <!–more–> quicktag.

    This then hides the data on the post.php page and displays it on any non-permalink page where you display the_content() up to the point of the <–more–> tag. You can then display any customisable content you want from the body of your post.

    It would still be easier to have selectable ‘excerpt’ quicktags though!! ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Customizable ‘sectioning’ quicktags *anywhere* in a Post’s content’ is closed to new replies.