Close

Account

Documentation

Forum

Menu

Display different header for each post category

  • Post count: 20
    saojoaquimonline
    April 13, 2018 at 6:29 am #30413

    I need to solve two small problems:

    1-) I have a news site and created a specific category only for the weather forecast: the category “Climaterra” and now I need all posts in this category to have the header or logo of the weather instead of the logo of my own site.
    According to this print https://prntscr.com/j4ihtr

    Remember that I only want to replace the header of all posts in the category “Climaterra”.
    How can I do this?

    2-) Previously jegtheme’s support passed me a code that should be replaced in my into functions.php, to fix a bug where youtube videos go beyond the smartphone screen. As this print: https://prntscr.com/iwv6nv

    This was the code sent by Jegtheme’s support: [For the video embed issue, please try to put this code remove_filter( 'embed_oembed_html', 'jetpack_responsive_videos_maybe_wrap_oembed', 10 ); into functions.php file.]

    but it did not work, what can we do to resolve this?

    Post count: 9468
    Adek
    April 13, 2018 at 9:12 am #30416

    Hi saojoaquimonline,

    1. Do you just need to replace the logo? Just want to make sure.

    2. That issue causing by Jetpack plugin. Can you tell what the version of Jetpack plugin that you use in there?

    Thank you

    Post count: 20
    saojoaquimonline
    April 13, 2018 at 9:42 am #30425

    HI Adek:

    1-) Yes, I want to replace the logo with this one: https://saojoaquimonline.com.br/wp-content/uploads/2018/04/climaterra-1.png

    I do not want advertisements, nor the menus in this header, only the Climaterra logo on all posts in the “Climaterra” category.

    2-) My Jetpack Version is the 4.9.4 – Remembering that my site is hosted on the wordpress.com

    Post count: 9468
    Adek
    April 13, 2018 at 11:42 am #30435

    Hi saojoaquimonline,

    1. I’m not quite sure about this thing, but you can try to use this code below and put them on the functions.php file:

    2. I’ve fixed that issue by adding some CSS code on the Customizer.

    Thank you

    Post count: 20
    saojoaquimonline
    April 14, 2018 at 6:20 am #30450

    I tried to use the above code but ended up generating a “500 error”.

    I need a lot to make this. I really want is that this logo is displayed in all posts (individual pages) of the category “Climaterra”. in this case all posts from the category “Climaterra”.

    Can you help me ?

    Post count: 2679
    Rai
    April 14, 2018 at 5:30 pm #30453

    Hi,

    I just tried those code above and it works, probably you paste in the wrong line, could you share your functions.php file?
    I highly recommend you using a child theme for this kind of customization, so you won’t lose it when there is theme update in future (which is very near).

    Thank you

    Post count: 20
    saojoaquimonline
    April 16, 2018 at 2:05 am #30484
    This reply has been marked as private.
    Post count: 20
    saojoaquimonline
    April 16, 2018 at 2:15 am #30485
    This reply has been marked as private.
    Post count: 2679
    Rai
    April 16, 2018 at 9:55 am #30510

    Hi,

    Could you provide your site URL so we could investigate it further?
    Probably, there is different category slug which we think it is “climaterra”. Please also clear cache if you use WP Super Cache plugin or any other cache plugins.

    Thank you

    Post count: 20
    saojoaquimonline
    April 16, 2018 at 10:40 am #30522
    This reply has been marked as private.
    Post count: 9468
    Adek
    April 16, 2018 at 2:41 pm #30543
    This reply has been marked as private.
    Post count: 20
    saojoaquimonline
    April 16, 2018 at 3:11 pm #30547

    Perfect … that’s exactly what I wanted, but now I needed a little adjustment.

    1 – If I click on the “Climaterra” logo it links to the main page [saojoaquimonline.com.br] and does not link to the weather page [saojoaquimonline.com.br/climaterra], how can we make this adjustment?

    2 – The “Climaterra” logo is not changing on mobile devices.

    Post count: 9468
    Adek
    April 16, 2018 at 5:27 pm #30565

    Hi saojoaquimonline,

    To achieve that, you need to make several changes in there.

    1. You need to create a new file on child theme folder /wp-content/themes/jnews-child/fragment/header/element/desktop/logo.php and use this content https://pastebin.com/G7spphP4

    2. Please remove the previous PHP code and replace with this one below :

    Thank you

    Post count: 20
    saojoaquimonline
    April 17, 2018 at 1:07 pm #30635

    HI…

    Well, we’re almost there, just missing a few minor tweaks:

    1-) The link in the logo (Climaterra) worked as a perfect, but he added the category [/category/climaterra/] and I would like the page link to refer only to the page: [https://saojoaquimonline.com.br/climaterra]

    See the print: https://prntscr.com/j699kb

    2-) The link on mobile devices is linking to the [saojoaquimonline.com.br] homepage and I need that link only page of the weather forecast, in this case the page: [https://saojoaquimonline.com.br/climaterra/]

    3-) I added the [logo.php] file in the child theme, according to the last recommendation, but the theme stopped automatically updating the homepage as the problem previously reported in: [Post Link: http://support.jegtheme.com/forums/topic/homepage-dont-update-when-i-post-a-new-post/#post-30140%5D – You must even keep Child theme active so that logo changes are allowed for the category “Climaterra” or Is there another solution? mostly for the cache problem on wordpress.com?

    Post count: 9468
    Adek
    April 18, 2018 at 10:32 am #30698

    Hi saojoaquimonline,

    1. You may need to use a plugin for that such as https://wordpress.org/plugins/remove-category-url/.

    2. Try to create this path on the child theme wp-content/themes/jnews-child/fragment/header/element/mobile/logo.php and use this content https://pastebin.com/sEzAfv9V

    3. I’ve been trying to implement this thing on my local server with JNews Child theme installed and just works fine. Please try to put that change on the parent theme instead of child theme.

    Thank you

You must be logged in to reply to this topic.