Viewing 13 replies - 1 through 13 (of 13 total)
  • Hi Emma,

    with a bit of Javascript and some CSS, sure, that should be possible. However, my plug-in won’t do styling for you out of the box. It can help with setting up the structure though:

    Add each category you want to show to the menu. Check ‘Create submenu…’ checkbox. Then, in the post navigation label, you can use %post_featured_image_url or %post_featured_image to add an <img> block. Surround this with various HTML elements to structure it the way you need.

    I can’t help you with the actual styling, you should do that yourself or find a front-end developer who can do that for you.

    Kind regards,
    Diana

    Thread Starter im_ema

    (@im_ema)

    hello Diana, thanks for the quick reply!
    however, I tried both %post_featured_image_url or %post_featured_image, but they failed to add the image, and I also tried to use %post_my_field(%featured_image)) for the custom field I made with another plugin called ACF, it didn’t seem to work neither.

    many thanks,
    Emma

    Thread Starter im_ema

    (@im_ema)

    FYI.

    I’ve set %post_title, %post_featured_image in the backend, and the html comes:

    <li id="menu-item-230" class="menu-item menu-item-type-post_type menu-item-object-post menu-item-230">
    <a href="http://localhost/isocity/transparent-solar-panels/">Transparent Solar Panels, 231</a>
    </li>

    seems 231 is what %post_featured_image returns.

    Hi Emma,

    thank you for reporting this, I’m sorry it isn’t working.

    I’ve tested this by setting “%post_title, %post_featured_image” for one of my categories in my test environment and there it works.

    Note that the “%post_my_field” wildcard does not work the way you used it. This wildcard exists only if you have set a custom field on your post. Example, creating a post and then adding a custom field “im_ema”, yields a wildcard %post_im_ema which you can then use

    As for %post_featured_image, I’m gonna need your help to reproduce this in my environment.

    Could you please tell me:
    – Are you using WordPress posts, or are you using a custom post type?
    – Could you check if the posts in the category indeed have a featured image?
    – Can you reproduce this by creating 1. a new category 2. a new _normal_ post with a featured image and 3. adding this category to the menu with %post_featured_image?
    – Which plugins are you using? Could you disable all plugins except mine to see if that fixes the problem?
    – Which theme are you using? Could you go back to the default wordpress theme to see if that fixes the problem?

    I hope these questions can help us isolate the problem.

    Kind regards,
    Diana

    Thread Starter im_ema

    (@im_ema)

    hello Diana, thanks so much!!!

    so for each question:

    Yes, I am using WordPress posts. – Are you using WordPress posts, or are you using a custom post type?
    Yup. – Could you check if the posts in the category indeed have a featured image?
    It works then, does it mean I need to create all the categories and posts again? – Can you reproduce this by creating 1. a new category 2. a new _normal_ post with a featured image and 3. adding this category to the menu with %post_featured_image?
    Advanced Custom Fields. As the last step works, then I haven’t disabled the other plugins. But I try to use %post_custom_field as you mentioned, it doesn’t work. But with this plugin I once mistakenly create a custom filed also called featured_image, would that cause the problem? now I have changed it to default_image, but it still doesn’t fix the problem. – Which plugins are you using? Could you disable all plugins except mine to see if that fixes the problem?
    A child theme under Twentyfifteen, also as the third step works, I haven’t try the very default wordpress theme. – Which theme are you using? Could you go back to the default wordpress theme to see if that fixes the problem?

    many many thanks!!!
    Emma

    Hi Emma,

    thank you for going through these steps.

    Your remark that you have once created a custom field called featured_image with Advanced Custom Fields is immensely helpful, I am going to do exactly that to see if I can recreate your problem that way. If I can, I will look for a solution. I will report back ASAP.

    In the meantime, you could perhaps try the following:

    <img src=”%post_featured_image_url” />

    Note that this only works well if *all* posts have a featured image, because the <img> tag is always added to the menu. Could you tell me if that works for you?

    Kind regards,
    Diana

    Hi Emma,

    I have reproduced your problem by, indeed, using Advanced Custom Fields.

    It seems that even though you changed your ACF field to default_image, in the database there is still data for the old featured_image field. ACF has not deleted it.

    My plugin used to always first look for custom fields, so this is the reason this happens. I have just changed this in the Development Version (tab ‘Developers’ on plugin page). Now, the plugin will first process the default wildcards like %post_featured_image and will process the custom fields last. That should fix your problem and this will be fixed in the next release of the plugin.

    Kind regards,
    Diana

    If you are willing to test the Development Version, I’d be very grateful for that. Please report any problems you may encounter.

    Kind regards,
    Diana

    Thread Starter im_ema

    (@im_ema)

    Thanks so much Diana!

    of course I am willing to help testing the Development Version. How can I do that?

    Emma

    Thread Starter im_ema

    (@im_ema)

    so I just download and install 1.0.1(svn)? πŸ™‚

    Hi Emma,

    if you’d be willing to test, that’d be great πŸ™‚

    If you go to https://wordpress.org/plugins/category-posts-in-custom-menu/developers/ and then under “Other Versions” click “Development Version”.

    This is not the same as 1.0.1(svn), because the Development Version is not released yet. So, when I make a new release next week, the Development Version will become 1.1. (Any changes I make after that will be Development Version again, until I release a new version again, etcetera. Hope I explained it properly πŸ™‚ )

    Kind regards,
    Diana

    Thread Starter im_ema

    (@im_ema)

    hello Diana! Sorry for the late reply! Have been too busy. πŸ™
    but the good news is: Yes, it works!!! πŸ˜€

    many many thanks!
    Emma

    Hi Emma,

    thank you very very much for testing the version. I will be releasing it shortly.

    Kind regards,
    Diana

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Category Lastes Post With Images’ is closed to new replies.