How to provide a convenient link to next post in Ghost Framework (Blog) - ghost-blog

Is there a way to conveniently provide a link to the next post in the Ghost Blogging Platform?
How to do that?
Ideally it would be dynamic. Therefore if I change the title of the next post I would not have to go to the post and manually change it there since it will know the details of the next post has changed.

You can use the {{next_post}} helper to do that. Inside this helper, you can use the usual post attributes, like the url or title.
Here's the implementation from my blog theme:
<div class="next-post">
{{#next_post}}
Next <i class="fa fa-angle-double-right"></i>
{{title}}
{{/next_post}}
</div>
Here's more in the documentation: https://themes.ghost.org/docs/prev_next_post

Related

How do I place a configurable meme at the bottom of the index page in ghost?

I'm working on a blog for a friend of mine who wants to put a meme picture at the bottom of the index page.
So the simplest way is to edit the template and reference it from there.
The problem is, it's not user friendly to keep editing and uploading a new template.
So I had this idea that I could create a static page and place it on that page and reference it from the template. But I see that when you upload an image to ghost.io it generates a name based on the date path. That's not going to work for a fixed URL in the template.
Another option might be to use the tags. As tags allows you to put a picture and has a URL. But I tried that it also has similar problems.
How can I make this work nicely?
Don't reference image URL in your theme. Reference page slug and load its content, which would be just an image.
Example with Ghost Handlebars API:
{{!-- If a static page "meme" exists - its content will be loaded here --}}
{{#get "posts" slug="meme" }}
{{#foreach posts}}
<div>
{{content}}
</div>
{{/foreach}}
{{/get}}

How to use conditional placeholder in custom template [wp plugin]

I am using event manger plugin.
How to use this code in a custom template file??
{fully_booked}content{/fully_booked}
You have to put your HTML content between the conditional placeholder. For example:
{fully_booked}
<div id="myId">
<p>
There are not tickets available
</p>
</div>
{/fully_booked}
Content will only be displayed if the condition is met, otherwise the whole placeholder will be omitted.
More info in Events Manager Doc
[UPDATED]
You can use it fomr PHP too, but it is a bit different. In the Plugin page you have a tutorial

Adding A Button Between post-content and Related Posts Thumbnail Plugin on WordPress

I am trying to add a button to my WordPress template. Basically, I have the post and then there is the Related Posts Thumbnails widget that appears. I want the button to go between the text of the post and the related posts thumbnail widget. The code in my 'Single Post' that contains all of this is as follows:
<div class="post-content">
<?php the_content(__('<em><strong>More:</strong> Read the rest of this entry...</em>', 'life-is-simple')); ?>
</div>
I know the Related Posts Thumbnails plugin falls within this code because it's at that place when I 'Inspect Element' on Google Chrome. I can't find how to edit the order of things within that div though. Any help would be greatly appreciated, thanks!
EDIT
Clarification: I am using the Life Is Simple WordPress theme although it has been custom editing quite a bit (mostly on the CSS side of things though).
That plugin is probably appending the output to the_content with a filter .
That means , that the output is being added to the_content automatically. it is a common behaviour.
You need to look at the pluginĀ“s admin interface to see if you can have an alternative way (I believe there is ) which is using a template tag. in that case, you should put the template tag after the div where the the_content() is .
EDIT I :
After a small dig, - in fact there is - you need to put
<?php get_related_posts_thumbnails(); ?>
Then the plugin should know by itself not to append to the_content.
For parameter passing, or if something is not working, go read their APi or help files.
You'll probably need to edit single.php or archive.php in your theme. If nothing is occuring there that looks familiar, it's probably using a loop. In which case you might find what you are looking for either in loop.php, loop-single.php, or loop-archive.php depending on what type of page you are on and how the theme was constructed. Add your button near where you find Read the rest of this entry...
With more information (such as what theme you are using), one might be able to help more as well.

Make Google+ button ignore and div of images on a blog page

I have an blog with related posts image in the top of it. I was waiting for something to fix it since they launch it, but didn't find anything yet so I'm asking for help with it.
The question is. When someone share an post with +1 button, it get the first image of the URL, which usually is one of the featured posts thumbnail.
In Facebook Share I got an plugin that get the 'featured image', but as far I researched, didn't find anyway to make it possible with G+.
So, one of the solutions I considered is making the "Featured post thumbnails" div 'hidden' to G+ button. Is it possible? Or make something similar?
You need to specify the +Snippet values. In the case where a post has no image make sure you keep the image definition but use the blog logo instead.
<body itemscope itemtype="http://schema.org/Product">
<h1 itemprop="name">Shiny Trinket</h1>
<img itemprop="image" src="image-url"></img>
<p itemprop="description">Shiny trinkets are shiny.</p>
</body>
In addition to Abraham's way, you can specify the og: meta data tags in the <head> section of your blog posts. See http://ogp.me for more information about the og: meta tags. The one you need is <og:image />.
IIRC, Wordpress has plugins that allow you to specify og tags.

Adding custom CSS to Drupal 7 to hide the message

I use my custom block for displaying a flash game at the front page of my Drupal 7 installation, but there is also the annoying message:
<div id="first-time"><p>No front page content has been created yet.</p>
<div class="item-list"><ul><li class="first last">
Add new content</li>
</ul></div></div>
below it and I can't remove it. Is there please a hook for adding custom CSS? In my module I would like to make the #first-time light grey or invisible.
I prefer not to add a blank content just to get rid of that text.
Thank you!
Alex
UPDATE:
I've added the following to my module:
function game_init() {
drupal_set_message('XXX init called XXX');
if (drupal_is_front_page()) {
drupal_add_css('#first-time {color: green;}', 'inline');
}
}
but don't see that CSS-code or XXX string inside my front page.
UPDATE2:
Oh, I had to clear the cache and now it works (the Drupal docs seem to be wrong here - there was written that 'inline' CSS is not cached...)
Hiding the CSS is the WRONG way of doing it. why did you created your content as a Custom Block?
you should create a "Page" and set this page as front page in the Configuration->Site Information.
Whatever. you can also use any of these options but is not recommended.
you can also also add a BlankPage by Adding only the Title(then hiding it in PHP on page.tpl.php)
you can add your css in /templates/themes/bartik.info
you can call drupal_add_css on the _init() hook of your custom module.
Blocks are used to display information in every page(although we can set to display only on certain pages). Say For Example. A Menu, or A Shopping Cart etc.
If you want to add some CSS for a module, you should use drupal_add_css()
Why not simply add this CSS to your theme?

Resources