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

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.

Related

Wordpress - TwenteenSeventeen picture instead of a title

I'm really new in coding, especially in css. I already read some tutorials but I like to change a specific thing. For my Website I use Wordpress. I also edited a few things in my CSS which already worked. Now I can't find a answer for how I can replace the title with a custom picture.
Click here to watch a picture to understand what I mean.
Click here to acess my website.
I already tried some things, but it would be nice if someone can explain me how to do it.
You can edit header.php in the twenty seventeen to display only a picture.
This source code is on your wordpress server in wp-content/themes/twenty-seventeen/header.php: https://github.com/WordPress/twentyseventeen/blob/master/header.php
You'll want to replace line 31:
<?php get_template_part( 'components/header/header', 'image' ); ?>
With something like
<img src="banner.png" />
You'll have to adjust the location of banner.png to where you actually upload the image.
After you've got that working and it's basically what you want, you can wrap the image tag in a a tag so the banner links back to your home page, if you'd like.

remove Category and archive from wordpress blog

I have a Wordpress blog and in my blog page it says:
Archives
Category Archive for: ‘Blog’
At the very top inside a div called inner
<div id="feature">
<div class="top_shadow"></div>
<div class="inner"><h1>Archives</h1>
<div id="introduce">Category Archive for: ‘Blog’</div>
</div>
I would like to completely get rid of this but do not see it anywhere inside of the settings. I am using the theme striking if that helps.
Adding an display:none; on the CSS may solve your problem. What do you want to remove exactly?
If the superior has an ID or a class, it would be as simple as #whateveriscalled {display:none;} or .whateveriscalled {display: none;}
Post exactly the div you want to remove.
Look in your theme or child theme folder for a file called category.php
in the top of this file you'll probably be able to see these divs, if you can't do a search for the word feature. If you find them just comment them out or delete them. Make sure you save the code snippet that you remove somewhere so that you can put it back if it breaks.
If it's not in category.php, it may be in home.php
hope that helps!

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.

Permalink-safe way to link pages inside footer.php

I am currently building a new theme for my site and am kind of stuck not knowing the proper way to link pages together. What is the proper way to direct visitor to another page if I were to write the link straight into footer.php?
Let's consider the following inside footer.php:
?>
A Link
<?php
That would work well up until I were to change my permalink structure to something else.
What is the proper way to do it(without using WP built in menus or anything similar)?
You can use get_permalink assuming your pages are in Wordpress.
See this link: http://codex.wordpress.org/Function_Reference/get_permalink
The above answer is 100% correct, but to save people some time when they stumble upon this question, I took the liberty of writing it out.
<?php echo get_the_title(12); ?>
This covers everything from hover text to dynamic page title, so if you decide to change "Contact" to "Contact Us," you won't have to remember to update the footer.php file.

Tumble theme: styling "single post" view

For my blog index, I use small-ish images (250px wide). If I view a single post, I'd like it to be bigger (e.g. 500px wide).
Is this possible? I can only see one block that applies to all posts.
I guess I'm looking for the WordPress-equivalent of single.php.
Thanks!
There's two tumblr tags that you might find useful:
{block:Posts}{/block:Posts}
and
{block:PermalinkPage} {/block:PermalinkPage}
The first set is the regular way of displaying your posts, where as the second set of tags targets "single" pages only. What I would do, if I was looking to change views between the index page and the single page, I'd wrap one set inside another, like this:
{block:Posts}
//Normal posts as displayed on the home page
{/block:Posts}
{block:PermalinkPage}
{block:Posts}
//Targets posts when displayed in "single" view...
{/block:Posts}
{/block:PermalinkPage}
Hope this helps & works :)

Resources