Wordpress Custom Fields for og:image - wordpress

I am building a website in Wordpress and I am writing some Articles. When I share my post/article on Facebook, the wrong image appears (on the phone, as on the computer it seems that the image is chosen correctly). I have seen that Facebook needs the og:image tag and it needs to be called in the head metadata. As I do not have many options to add metadata to the page, I felt like using the Custom Fileds in Wordpress as being the cleanest way. As I am new to this and I am not sure I did it correctly, please guide me on how to call these custom fileds to the head metadata part of my page when it loads. I have attached a snip of my custom field here:
custom custom field
Please let me know if my thinking was correct or if I should use another method to accomplish this.
Thank you very much.

Related

woocommerce - add a new functionality to the theme along with its UI

I am new in wordpress world and i am planning to do a small store website, all the functionalities i need are already there in woocommerce, but there is this small functionality i need which is as below:
in the homepage i need to show 3 different services are served from the company and each service will have a button which will show a popup or redirect the user to another page.
the popup or the new page will ask the user to enter his information along with his mobile number so the company could contact him.
and i have chooses this theme https://themebeez.com/demos/?theme=orchid-store
and here is a picture of where exactly the change will be
So my question is what is the fastest way to do that, is there a plugin to do this for me, or i should make the actual functionality myself and edit the theme code also manually?
Thanks.
In the homepage i need to show 3 different services are served from
the company and each service will have a button which will show a
popup or redirect the user to another page.
Basically 3 buttons that got you to another page. That can be easily done with just editing the template. Look the support documentation to see if your theme can be edited by some page builder (mine uses Composer, etc) and just add the "buttons", if not you need to edit the template manually with some HTML. Nothing to complicated, it just HTML, not PHP or JS.
the popup or the new page will ask the user to enter his information
along with his mobile number so the company could contact him.
Blockquote
Please clarify, popup or a new page? If it is a new page, when you create the 3 buttons on the homepage, just connect that to a new page each (in the Admin Panel, New>>Page). That it is easy as just but the <a href> tag. But also, that's just how I would do it in a short time.
So my question is what is the fastest way to do that, is there a
plugin to do this for me, or i should make the actual functionality
myself and edit the theme code also manually?
Asking for plugins is offtopic in SO, also, where is going to go that data? In the database? or is going to be sent to some admin email? Please see the How to Ask
But I think there is exist a lost of plugins to help you with that. You just need some custom fields so Have you tried searching for some? I use one to get in contact with clients which may fulfill your requirements

How do I call a plugin in a custom page for wordpress?

So I am trying to do this and I don't know how. I have a wordpress powered website with a plugin called "frontier-post" in it. This plugin makes a new front-end post submission. The way to use it is to put the shortcode "[frontier-post]" in any post in my wordpress page and that page turns into this.
I want to make a custom page for myself, where I can have the content created by this plugin there too. So I do not want it to be a post in my wordpress, but lets say at a corner in the custom page. I have searched and found these but the suggestions there would not work. I am able to include the wordpress so that the custom page has access to posts, etc. but even using this
echo do_shortcode('[frontier-post]');
would not help me. (even if header is included)
These are the similar things i found:
Wordpress/PHP - How to use plugins outside wordpress-powered pages?
Need Help for my Custom Page Template
I would really appreciate it if you could help me with this.
If you are creating a PHP page that isn't going to be rendered inside WordPress, you can't use a Plugin of the WordPress engine to accomplish what you are wanting to build. (As the accepted answer to one of the pages you link to indicates).
Instead, you might be able to use the json-api plugin and have your custom page query it for the data. While it won't render the shortcode, it will give you the raw data to work with.
http://wordpress.org/plugins/json-api/
Edit:
Based on a comment, your do_shortcode should work...just try it without the square brackets.

Which WP plugin for enabling users add posts without registration?

I would like to know which WP plugin should I choose to allow every user who come to my page to add a post to my page form the frontend.
He just click on a button add a new post or something like that. Than a form appear and he inserts the title and uploads an image.
After that its published as a post.
Is there a solution like this available for WP?
Thanks in advance.
From what I know, there is no existing plugin doing it as you need. Even if it existed, I wouldn't recommend it's use for security reasons; it is hard to follow every uses and make sure visitors would post the way you want.
You are definitely better to code it by your own, and it's quite simple using the wp_insert_post function. This function will work anywhere you put it inside Wordpress (no need to build a plugin from scratch), so a simple form with validation would make it.
Hope it guides you on what you're looking for.

Changing open graph image tag based on blog post item

I am maintaining a wordpress blog and am familiar with using the og:image meta tag to set the default image that is included when a like button is pressed. What I want to know is if there is a way to make this image dynamic based on the item liked.
I am trying to build it so that the first image in a particular blog post that is liked is what is pushed to the facebook feed post, with the blog's default image only used if there is no image in the post. Does facebook provide any way to do this with the graph api?
I tried writing javascript to change the meta tag on article pages (rather than the homepage) but found out later the crawler does not run javascript, so am now considering implementing the same but server side with PHP. This still would not solve the problem of Likes from the blog homepage, where there are multiple blog items on the page though. Any advice would be greatly appreciated.
Thanks
The only is changing how the meta tags get rendered to the client, in server code or in your layout template. There is no graph api method for this and you can't modify the tags with javascript as their scraper doesn't execute javascript.
Also, the scraper won't keep re-visiting your site so once it access it, it will be cached until you go to the url linter tool manually. so for the home page, you would probably just want the default image.

How to add custom URLs to my WordPress template files?

I'm developing a WordPress theme and I need to have a custom URL for some kind of content.
For example, I need to have a page to show some article details. Now, i've created a page template called "Article", and so i've to create a new page and give it the page template "Article"
(I get the url http://mydomain.com/article?id=123)
It works fine, but now i'm having dozens of this pages, and it's a mess to create them all on every installation of this theme, so i want to do it in my theme code.
I saw something near that on BuddyPress, where you can use /member/ and it redirects to a member page. I just wanna know how to do so.
Thanks!
If you are running wordpress 3.0 I would recommend making a custom post type for your articles. That would allow you to control the URL in the way that you want and also allow you to use more sophisticated full text urls if you wanted to.
Here are some links to some tutorials about how to make a custom post type to get you started:
http://kovshenin.com/archives/custom-post-types-in-wordpress-3-0
http://kovshenin.com/archives/extending-custom-post-types-in-wordpress-3-0/
The second one has an example file that you can download and edit to help you get started.
Cheers,
Paul

Resources