WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Content Extract / News Update in Tile (1 post)

  1. martyalwaysready
    Member
    Posted 3 years ago #

    Hi,

    Do you know if there is any code that is specifically working with WordPress that can pull in and update automatically small amount of text from whole text in WordPress page (but excludes the post/page heading or title including its date in the whole text)? The reason that I am asking this is that we would like to use this code for the tile in client website where text is being update-able automatically when the other page in WordPress admin area is updated. 

    For example, there is a tile called Case of the Month in the bottom of page where there is following text: "We have just purchased new equipment.." a part of extracted text - and "Read More" which is a link to full post, so when it is clicked it goes to Latest News page that displays these following:
    - Page heading: "Latest News"
    - Text underneath: “We have purchased new equipment for monitoring changes in heart rate of patients. This features high-end technology to detect even smallest hard-to-detect heart bumps ....."

    I have used the following code as I could only think of:

    1) The Get a Post code statement : <?php get_a_post(31); ?>  where 31 is the ID number of post or page in WordPress administration.

    2) The Content Extract code: <?php wswwpx_content_extract ( '(More...)' ); ?> where "More..." is the text to be displayed after the extracted text from page with ID of 31 (see above).

    However, there is problem that we were having with the above code as the issue was that the page heading was also retrieved and thus become the part of text in the tile, since the heading is also the part of text in that page. We do not wish the text in tile to auto-update with the page heading on it.

    If you know of other solutions to remove (or perhaps some sort of in-line code to "hide" first line of extracted text) the heading in the extracted text in the tile, or any means of other content feed (like News Update tile), then that would be great and helpful for future projects.

    Many thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 3 years ago by martyalwaysready
  • This topic is not resolved
  • WordPress version: 2.9.1