-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for featured image display/import #5
Comments
Hello, Thanks |
Any news on completion date? |
Nope, not at the moment. |
same here... any ideas for workarounds anyone ? |
works for me now. make sure to use get_the_post_thumbnail() to retrieve it. looks like the_post_thumbnail() and has_post_thumbnail() don't work here. also had to hack in/fork for different thumb sizes as my themes thumb sizes and 'full' didn't work... |
@streiten what changes did you make and to which file? |
@tw2113 actually after revising my code i didn't change anything in the plugin code. in my theme's function im hooking in the // define thumbsizes for aggregating blog posts
function sitewide_tags_thumb_size_cb( $array ) {
return array('full');
}
add_filter( 'sitewide_tags_thumb_size', 'sitewide_tags_thumb_size_cb', 10, 3 ); for my theme itself i had to do the follwing changes to make it work: <?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail(); ?> to <?php if ( !empty(get_the_post_thumbnail($post->ID,'full'))) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php echo get_the_post_thumbnail($post->ID,'full'); ?> |
Gotcha. Thanks for that explanation. :) |
I have the same problem but unfortunately don't know how to change code. Is there an indication when this will be fixed in the plugin. I appreciate your great work! |
No timeframe I'm aware of, we're not actively working on the plugin as of late. |
Hello, Streiten, as well as changing the function file, could you tell me which file in the theme you changed this code?
` ` to ` ID,'full'))) : ?> ID,'full'); ?> ` |
@PJSAnd totally depends on the theme you are using and how its template files are structured. could also be nested in a function. for twentysixteen this would be |
@streiten thanks. OK, I'm no techie and I'm not using twentysixteen...are you able to tell which file to edit from viewing the page via firefox? My test page is at nisekotravel.com - any chance you could have a look |
@PJSAnd no, you can not really find it from looking at the website/markup. looks like a custom theme - contact the theme developer. also the conversation getting a bit offtopic now... :-) |
I do believe the topic has swayed away from the original issue. I believe when I opened this, it was more about getting the featured image data included and into the aggregated data, and less about display issues on the frontend. |
I have located the code which I think I should edit to show the feature image data included. Below is the code and I have tried to edit it but without any success. I would appreciate it a LOT if you can give me some help here:
|
@boeta2016 I have no idea what that's referring to, as it's not part of this plugin, from what I can see. I also really think the discussion here is veering away from the original intent for the issue, which is to make sure featured images for posts are sync'd into the aggregated site. Nothing to do with displaying anything on the frontend in a given theme. |
I do not agree with the discussion veering away. I had a look at what @streiten did where he changed the code in his theme. So I searched in my theme to what I think I need to change to make sure featured images for posts are sync'd into the aggregated site. The code that I gave is what I need to change in my theme to get that images into the post. |
Which is why I feel the discussion has veered away from the originally opened issue topic. The issue is about ensuring that the featured image is part of the data/content that is sync'd into the aggregated site install. However it's not about the display of said content in a theme file. Regarding your code above, I'm not sure what exactly is not working. What's the resulting HTML output that you're seeing, compared to what you're expecting? This part is also best fit for https://wordpress.org/support/plugin/wds-multisite-aggregate instead of here in GitHub. |
The post that are aggregated to the main site are missing the featured image. When I open the post in the wordpress editor the featured image from the original post is not there. There is nothing wrong with my theme because if I update the post and manually add the featured image to the aggregated post it shows. I cannot however manually edit each post that aggregates. I need the featured image to be included into the aggregated post. |
Which is what this open issue IS about. Making sure they get imported/migrated over. |
OK - so HOW DO I MAKE SURE THE FEATURED IMAGES ARE MIGRATED OVER TO THE MAIN/AGGREGATED BLOG? Surely this IS on topic :) |
I don't know why it may or may not be working at the moment. I haven't had a chance to sit down to thoroughly check and test. From looking through the code only, this spot should be covering it, https://github.com/WebDevStudios/WDS-Multisite-Aggregate/blob/master/wds-multisite-aggregate.php#L298-L304 as the featured image to use is stored as a meta key of |
Sure, OK. When you say 'this spot should be covering it', can you make a suggestion as to what I should do to this bit of code to get the plugin working properly? I know this is s free plugin, which is great, but surely it can't be that much of a big deal to get feature images carried through along with the text to the main blog....surely!!! |
Well, my first question would be have you confirmed it's not? or are you just going based on the issue here existing? It could be an invalid ticket, and the feature working as a whole. Perhaps the meta fields is migrating properly, but values are mismatching or not finding an attachment of the proper ID, meaning there's a different bug. |
Well, tw2113 what's your opinion? Are you saying that this is an invalid ticket and a waste of everyone's time? Back to the issue: It doesn't seem to be working on any theme that I've used including the standard 2014/15/16. This would suggest, I would guess, that there is a compatibility issue with the plugin and wordpress. So yes a mismatch could be the problem. But I'm no techie and would not know where to correct this. Look, if you can help...great. But if you have no intention of helping solve this issue (which I suspect looking at the comments above) then please just let us know rather than stringing us along with vague comments like above. That would save everyone's time. |
My opinion is that testing is needed to confirm. The more the better, from anyone willing. I'm not worried about the frontend display, because that's dependent on the theme being used by the site owner. I'm concerned about if the aggregated version has the correct thumb displayed for each post in the WP Admin. It's not that I can't or won't help, but time is the proverbial issue for everyone. Based on the code I highlighted above, it SHOULD be covered already. We had one person report issue. I'll try to carve out some time soon to test myself. It just may not be today. |
So, I found myself with some time tonight, and in conclusion, I do have to apologize on a number of levels. In large part, because I'm not one of the original devs of the plugin, but still generally handle frontline support for it. So I have my own holes of knowledge around the plugin as a whole. From my testing and checking, it does NOT indeed migrate the _thumbnail_id field, and I have to believe a lot of that is because it would require also importing into the aggregated website, due to how featured images and attachment IDs work. What I did see and find with my tests is that there are meta fields with meta keys of "thumbnail_html" and "thumbnail_html_thumbnail" by default. In those are HTML image tags storing the URL to the appropriate file on the server. There are filters to add more image sizes as well for the sync. Standard get_post_meta() calls with the appropriate ID and meta key will fetch those fine. It's not the most "ideal" way to handle featured images, but it would, in fact, work. Other metadata items I'm seeing attached include That said, to satisfy the original intent of this issue, would require amending enough to set both the |
Thanks for that. But how do I do that in practical terms?
…On 23 Nov 2016 6:08 am, "Michael Beckwith" ***@***.***> wrote:
So, I found myself with some time tonight, and in conclusion, I do have to
apologize on a number of levels. In large part, because I'm not one of the
original devs of the plugin, but still generally handle frontline support
for it. So I have my own holes of knowledge around the plugin as a whole.
From my testing and checking, it does NOT indeed migrate the _thumbnail_id
field, and I have to believe a lot of that is because it would require also
importing into the aggregated website, due to how featured images and
attachment IDs work. What I did see and find with my tests is that there
are meta fields with meta keys of "thumbnail_html" and
"thumbnail_html_thumbnail" by default. In those are HTML image tags storing
the URL to the appropriate file on the server. There are filters to add
more image sizes as well for the sync. Standard get_post_meta() calls with
the appropriate ID and meta key will fetch those fine. It's not the most
"ideal" way to handle featured images, but it would, in fact, work. Other
metadata items I'm seeing attached include blogid and permalink which
correspond to the blog ID the data was fetched from, as well as the
original post permalink.
That said, to satisfy the original intent of this issue, would require
amending enough to set both the _thumbnail_id parameter as well as make
the image itself get migrated into the aggregated new site.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALa4n0k7bKuC1aU-YCr1l_rr3iqfZ64cks5rA9higaJpZM4Ixiuz>
.
|
If you're wanting to have the aggregated post have the featured image field set specifically, you're going to need someone willing to modify the plugin to handle that. You could also just use the meta fields I pointed out that store image tags of the aggregated featured image, as that would get you something to use. It appears to be the solution to the topic our devs originally went with. Provide HTML image tags, stored as post meta, instead of import every image involved into the specified aggregate site. If I recall right, there's a filter that can be used to set more image sizes to be included. I'm actually agreeing with the solution provided in this case, and feel we can close this GitHub ticket as a non-issue. |
Please I'm facing with this problem, I have 1 week try to solve it and test different Wordpress themes, so please can you help me to solve it with Ipin theme? My single.php file
And my index page file
and my function.php file
Please I really need help, I'm starting my first little web project. |
So which theme I can use to see how it work? |
The question isn't around theme, it's around making sure the posts you're trying to display have a featured image associated at the time of display. Both your single.php and index.php files have spots that check and try to display the featured image, so why it may not be, depends on one being set. |
@mguenscher also see my reply at #5 (comment) as it highlights findings I made last November regarding featured images, and how the aggregated area tries to handle the topic. |
https://wordpress.org/support/topic/1-issue-and-1-suggestion?replies=1
See #5 (comment) regarding how plugin currently handles aggregated featured images.
The text was updated successfully, but these errors were encountered: