How do I render HTML elements on the index page of a ghost blog? - ghost-blog

Is there a way to make the post preview on the index page render like the permalink page?
Just to be clear the index page excerpts the first few lines in plain text. The permalink page displays the content withing HTML elements.
I understand that this is probably by design, but it occasionally makes a post preview illegible.

What the Excerpt!?
With Ghost an excerpt is a small preview of a posts content, usually included on the index page. The excerpt is stripped of any HTML elements and rendered as a string:
{{excerpt words="50"}}
Show the Content
It is possible the content, with HTML elements included, on the index page. Replace the code above with the following:
{{content words="50"}}
Use with caution!
As words="50" of content includes HTML elements and words, you may end up with unclosed HTML elements.

Related

replacing anchor # to full url in wordpress posts

I trying to replace the anchor "#downloadbutton" to the full url in all posts.
for example:
#downloadbutton = https://mywebsite.com/kindness-and-gentleness/#downloadbutton
#downloadbutton = https://mywebsite.com/islamic-etiquette/#downloadbutton
#downloadbutton = https://mywebsite.com/hindrances-on-the-path/#downloadbutton.
The reason for this is that when I create excerpts which include anchors from the posts. The anchor urls are not working except if i go back to and change the anchor #download to absolute (full) url. and there many posts. Is there any way to do it through php snippets. Am using wordpress.
Thanks in advance
You can't remove hyperlinks hooks from the url. Hyperlinks hooks are just a way to navigate to a specific content more quickly. For example https://ownwebsite.com/#testimonials will show you the testimonials section straight away on page load.
The only thing you can do is replace the url from the button with your specific url, that way instead of having an hyperlink hook button, you would have a regular plain'ol button that redirect you to a page or else..
You can learn more about the <a> html5 tag behaviour # https://www.w3schools.com/tags/tag_a.asp and you can see a live example of the behaviour # https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_a_href_anchor

How to add HTML text to every page using Google Optimize?

I would like to add a few lines of HTML to every single product page on my website.
However, it only works on one URL. I'm really sure my URL targetting is setup correctly.
I've selected an element on the page – and used "HTML" and "Insert" to add the code to the page. However it doesn't work on every page.

inline image class are present in content on single post page, but removed from excerpt in homepage

I have inline images in my post content that have classes. the classes are available as I go to single page like this:
<img src="the_cource.jpg" class="myclass">
, but are removed as I look at them on my homepage by using excerpt.
<img src="the_cource.jpg">
does wordpress manipulate the classes, in excerpt?
This is a yes or no question, and the answer is 'no'. Normally, dynamic excepts are created from the content of a post, and has nothing to do with images. If images are being displayed and the classes are being modified from one template to another, it's something happening in your THEME, and not something that's happening because of the Wordpress core.
Yes WordPress removes a lot of content in an excerpt. By definition, the excerpt is only text.

How do I modify number of words displayed for blog posts in Orchard CMS?

When I go to the blog, only ~50 words per post are displayed. How can I edit this so more words get displayed? On the same note, how do I get images to be displayed as well?
The default template for the summary of the body part (the main content for a blog post) strips html formatting and take the first 200 characters. You can override this by creating an 'alternate' view in your theme. The easiest way is to use the designer tools shape tracing feature to override the template:
http://docs.orchardproject.net/Documentation/Customizing-Orchard-using-Designer-Helper-Tools
The result will be to create a copy of the Core/Common/Views/Parts.Common.Body.Summary.cshtml in your theme's views folder and then you can adjust the Html.Excerpt(bodyHtml, 200) to the length you require.
As the summary excerpt strips out html, your images will be removed. You might be better to include a separate thumbnail image to using in your blog post summary. You can then adjust where this is displayed using the placement file. See this post:
How to add Image Field to Blog Post Summary in Orchard CMS?

print stylesheets - how to print all pages of paginated content?

I'd like to use CSS to specify a stylesheet for printing (instead of the "print friendly view"). The problem is that my web site has long article content that is paginated. When printing a paginated article using CSS, only the current single page gets printed instead of the whole article.
Is there any way to control the printing so that when the user prints the "all pages" view is printed instead of just a single page?
Sometimes you need to create custom output, just for printing. Same stylesheet, just with all the content on one go instead of paginated.
I sometimes put a parameter "printmode=1" or something, then load the content into a hidden iframe on the same page and print it from in there.

Resources