If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.
March 6, 2013 at 9:51 pm #20963
I have a few metaboxes in my portfolio which displays on the frontend like urls to social media network, I’d like to grab the individual meta box data and use it as a link for an image in the front end, how would I go about doing this?
Thinking something along the lines of this:
<a href="<?php echo meta post data somehow ?>"><img src="imagelink.jpg"></a>
Any help would be appreciated!March 10, 2013 at 7:56 pm #109832
They are beyond my meager skills to reach, however here is a shortcut. I pasted some code http://pastebin.com/ehT0sZVx since its too big for here, and this will create an additional meta field on the portfolio item admin page labeled Special URL bellow the current meta fields. In that field you add the url you want to use as a link. Just add the block of code from the above url to the end of functions.php. I tested and it works fine.
Then you can use the php below in the link on the portfolio item page as you wanted. The code below will echo the url in the new meta field.
<?php echo get_post_meta($id, 'nick_portfolio_url', true);?>
NickMarch 10, 2013 at 8:23 pm #109833
Thanks Nick! However – I’d really like to grab the ones I’ve already set up, as I have a number of them. I’m assuming something similar to the above would work as long as I can figure out the ID of the individual metaboxes (which I haven’t yet).
Is there any other admin on here you can flag to this topic? Would really appreciate it!March 11, 2013 at 3:08 pm #109834March 11, 2013 at 3:51 pm #109835March 12, 2013 at 3:04 pm #109836
Unfortunately it me be a bit of bad timing right now as Kriesi is in the middle of both woo commerce updates and working on a new framework/extension for Avia so he is pretty busy. I think he said he was doing 17 hour days last week and I don’t imagine they have gotten shorter with the various WC2.0 bugs popping up.
DevinMarch 12, 2013 at 10:44 pm #109837March 14, 2013 at 11:19 am #109838
What I provided will work dynamically as well, you will just have to fill it out once on every portfolio item to add the url you need. I think if you try it you will see the benfit during this interim.
NickMarch 14, 2013 at 5:02 pm #109839
I have a backup plugin that creates metaboxes for me dynamically and am going to use that for now. Do keep me posted on the progress here, as I would love to implement this as a more permanent solution.
Thank you in advanceMarch 15, 2013 at 5:35 pm #109840
I’m going to soft close this for now until Kriesi has a chance to take a look (but it will also keep it from popping up in our Queue as an un-addressed topic).
DevinApril 15, 2013 at 8:31 pm #109841
Hey! Just wanted to tell you that for now there is nothing planned to add this functionality to the teheme itself. If we get the request more often we might add it but since you are pretty much the first one and you were able to solve the issue with a plugin I think it wont go up anywhere soon on the todo list :/
The topic ‘Replacing meta info into logos’ is closed to new replies.