I’m using a new plugin and need to find the source code of the featured image on the posts. After some research I found this nice little snippet of code and it works GREAT!!! Now I just need to find out how to only get the uri!! Any help would be much appreciated!
$imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full");
You can also get the width and height by using the array 1 or 2 like this:
$imgsrc returns the width.
$imgsrc returns the height.
About the AuthorWhat's UP! This is my site, I write 99% of the articles on here. I'm also the owner of SureFireWebServices.com. I help out a lot of developers and designers getting into the web game. Helping is fun for me, so feel free to ask me any questions! I've made courses and have a membership as well to help get you on your feet!
You Might also like
By Jonathan Perez — 6 years ago
Something that always comes up with web designers/developers is pricing. Why is it that there are people out there that will do a website for a few hundred bucks, and others that charge thousands!?
I used to work for a company where prices were just random numbers thrown together! This is $300 and that’s $1000, but there was absolutely no justification in why things were priced that way.
Here are a few tips that I picked up along my career, that will show you how to price your services better. Read MorePost Views: 1,726
By Jonathan Perez — 7 years ago
This is in response to one of Six Revisions latest articles, 8 Things they don’t tell you about being a web designer. Now though the article wasn’t bad, I feel it took a completely wrong approach and if I was trying to decide if I wanted to be a web designer, their article would not have helped me at all!
I remember when I was in high school trying to figure out what I wanted to go to college for. I picked design because of all the cool perks and stories I heard.
Perks like one lady having a limo pick her up to work everyday, free tickets to events, great gifts that clients give for designing something amazing for them.
Stories like you’ll have so much free time, it’s such a lax profession, it’s always changing.
It’s all bullshit! At least for the majority of designers it is.
So let me say I’m sorry to six revisions but this is the Real stuff they don’t tell you. Read MorePost Views: 3,117
By Jonathan Perez — 2 years ago
I use Toolset all the time. One thing that constantly annoys me is when I need to create a simple grid loop. For some reason, Toolset loves to stick with tables as a grid format, unless you’re using Bootstrap. Well, I don’t want to use Bootstrap. I use Genesis.
So here’s a simple way to get your grid loop working with Genesis and any other theme for that matter.
What Views Gives You
When you go into views, and you’re getting ready to create a loop, you get the options of “Unformatted, List, Table Grid, Bootstrap Grid, etc.” Bootstrap grid, however, is blocked out because it knows that you’re not using Bootstrap. You’re damn right I’m not! (I like bootstrap, but I use Genesis)
So when you select the table grid, here’s the mess that Views gives you.
Let’s fix it and use the classes that are already included in the Genesis Framework.
Yay!! Now it’s clean. Here’s a quick explanation of how this grid works.
How The Grid in Views Works
The first part of the grid looks like this:
That means that it’s the first cell or the first place in your grid. So if you’re doing a grid with 3 columns, this indicates that it’s the first placement of your grid.
The second key factor in this setup is
This is equal to all the in-betweens in your grid set up. So if you have 5 columns, 10 columns, or 3, the index=other is everything in between the first and last column.
Next, you have
The three in this fancy little shortcode is the last column. You can make it whatever number you want, but keep in mind that this will be the last column in the grid.
I’m going to group the next two gems together. They are:
This little gem is the filler for when your grid ends. If you have a grid with three columns, but you only have 7 items. That’s going to throw the grid off.
So pad, once again, is the in between fluff. Similar to index=other except that, it’s empty. You may have already guess what pad-last is, but if not, it’s the last empty shell in your grid.
The point of the padding is if you have a background color or things that you need to clear, you can do it in the last empty column and continue the look of your grid without having it break the grid itself.
Isn’t views awesome! 😀
Have any other cool methods for a grid? Let me know in the comments. Otherwise, enjoy!
What’s that? You don’t have the classes! No problem, here you go!Post Views: 1,018