Hide Image for Related Post & Author Box from specific category

Posted in: Newspaper
Post count: 73

I would like to hide image from related post box for certain specific category alongwith its child categories. Similarly, would like to remove author box and ‘more from author’ box from certain categories alongwith its child categories.
For doing that I added following code in css:

.td_block_related_posts .td-module-thumb {
display: none;
}
.td-related-right, .td-author-description{
display:none!important;
}

but problem is that it hide both thing from all posts. Further, it does not hide image and name of author from More article box of specific category and its child categories / posts from specific author.

  • This topic was modified 9 years by munvik.
Post count: 22421

In order to hide the images from multiple theme elements, you will have to edit that particular theme element and create conditions in the code for it. It will be no walk in the park though. Here is an example.


   <?php
                if (!in_category('featured')){
                echo $this->get_image('td_218x150');}
                
                ?>

The condition explanation is as follows. If the post is not in the fatured category, then get the image for it.
else, do not get any image.
So changing the featured category in the code you will be able to make the element not grab the image for that specific category. In the related articles module, you can wrap this code in the condition:

https://www.screencast.com/t/jpSd4qegeD7A

This is how you can implement such features you request.

Thank you!

Post count: 73

I think I did not explain the thing properly.
In short, I would like to hide following thing for the specific author:

a. Image shown under the single post in the heading Related Post Tab, related post will be there with title but image will not appear

b. Hide More from Author Tab under the single post for the specific author

c. Reference for author wherever occurred for that specific author.

The reason for hiding this is in this type of post category (including its child category), I am trying to provide various circular, notification, order, etc. issued by Government and for these type of stuff reference to author is not proper.

Post count: 22421

Unfortunately you cannot hide specific theme elements based on the post author easily. You have to create conditions as I have shown above but it is no simple matter. Css does not know how to hide things based on the post author in different elements. You will need to hire a freelancer to help out as this requires quite a bit of customization. You have to add conditions to the related articles and more from author elements to remove the content from specific authors. In this case the function must be changed as it is created to bring content from all authors. Sorry but we cannot offer any custom work at the moment.
Thank you for your understanding.

Post count: 73

1. Facebook share button does not display number of shares.

2. Adsense link unit is not working properly. Sometimes it shows display ads.

Post count: 22421

Hello,

1. The facebook share button does not have this kind of implementation, sorry. It was never meant to show the share count.

2. The adsense link units could require special implementation such as a code added to the header or footer. You should follow the adsense implementation guide for these types of ads.

Thank you!

Post count: 73

On pagespeed insight, mobile version said that following is blocking scripts:
/wp-includes/js/jquery/jquery.js

However, on desktop version, it said that 2 blocking script resources and 19 blocking CSS resources.
JS
/wp-includes/js/jquery/jquery.js
/…includes/js/jquery/jquery-migrate.min.js

And lots of CSS
Though I used speedbooster plugin and followed the guide but still it is showing. Whats wrong

Further, it said Minifying /themes/Newspaper/style.css?ver=7.6 could save 12.9KiB (14% reduction) after compression.

How to resolve these issues

Post count: 22421

Hello,

Please also check if speedbooster is active in the system status section of the theme. Speedbooster has a compatibility function in it’s code. Please check this topic for more information: https://forum.tagdiv.com/topic/tinymce-advanced-and-other-various-disabling-speed-boster/

Thank you!

Post count: 73

Speedbooster v 4.5 is active.

Post count: 22421

Hi,
It is not enough to activate speedbooster, You will have to follow the instructions presented here: https://forum.tagdiv.com/how-to-make-the-site-faster/ at point 5. And please note that speedbooster will not be able to move all of the js and css for all plugins though as you can make it work with all plugins by removing the compatibility code but you cannot make it move the css and js for all plugins.
Thank you!

Post count: 73

I followed that guide and move all css and js at places mentioned in the guide. Does it suffice

Post count: 22421

Test it out with the google page speed. I cannot say for sure if it will move all of the js and css as I do not know what plugins you use. Try to activate speedbooster, run a speed test and then deactivate speedbooster and test again. Then comp[are the results.

Thank you!

Post count: 73

asking very silly question, I want to reduce space. see screenshot
https://www.dropbox.com/s/uly7zh1iwpbdg1e/space.png?dl=0

Further,
how to increase width of dropdown box in smart list 8
see screenshot https://www.dropbox.com/s/bq4bq81r5g6iq27/space2.png?dl=0

Post count: 23312

Hello munvik,

Provide your website URL so I can inspect it closer and also, so I will be able to provide a more accurate code.

Thanks for the message!

Post count: 73
Post count: 20688

Hi,

You could decrease the line height for the elements used in the post content, now I see that you have set a custom line-height for the headings – https://www.screencast.com/t/Sgv3o4zRE6 Also each paragraph in the post content has a default margin property set – https://www.screencast.com/t/OsjRTp7S1H you could try to reduce it

.td-post-content p {
margin-bottom: 10px;
}

You can increase the width of the dropdown in the smart list using this code with this result – https://www.screencast.com/t/Ozyrrsiu

.td-smart-list-dropdown-wrap
.td-smart-list-dropdown {
max-width: 60%;
}

Thanks

Post count: 73

Thanks. I am trying with your suggestion.

Further, My sidebar contains ‘Stay Connected widget’ and I am hiding sidebar on mobile. The problem is that now mobile user is unable to use that widget on all post. Is there anyway to resolve it.

Post count: 20688

Hi,

From what I can see you have a display none property on the social counter block – https://www.screencast.com/t/W7CNXgzp5 in your homepage, and the same property on the sidebar in the single post page – https://www.screencast.com/t/yvCeeS3e So if you want the sidebar to display on the post page you will have to remove that display none code.

Thanks

Post count: 73

Thanks
One new problem after updation to the latest version of theme
https://www.dropbox.com/s/3mjmoornjczuf8r/js%20error.png?dl=0

please look the page http://viewpublish.com/tds/
Unable to click on Toggle.

Post count: 73

When I disable Speedbooster plugin, it works fine.

In speed booster, in a function ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js has been called, but js used in the jquery foldwe of wordpress shows version 1.12.4

Is that is the reason. If yes, shall I change the version of jquery in speedbooster file to resolve this conflict.
Waiting for your reply

Post count: 20688

Hi,

It seems you have some kind of content protector that is blocking the js and could cause this issues and more, like the search function on the menu, pagination on blocks and more – https://www.screencast.com/t/TniCsALXlj Try removing the plugin or code that is causing this and test again.
Also please create a new topic on the forum after the current issue is solved, so it would be easier to read the thread for other users and avoid confusions.

Thank you for understanding

Post count: 73

I deactivated the protection plugin. Now check the main issue

Post count: 73

One reason for continuing on the same page of forum is that I forgot from where from a new topic can be started

Post count: 73

Please use small screen size for see the problem

Post count: 20688

Hi,

I see there are still a lot of js errors on the respective page that you are implementing that table, preventing the theme’s good functionality (thumbs not loading, search function and pagination not working) and also you are using multiple plugins, that I have no way of predicting which one is causing this and how they are affecting the theme’s css and js. I have no solution for this and can only suggest you try disabling them one at a time as a test and check the results.

Thank you for understanding

Viewing 25 posts - 1 through 25 (of 25 total)
The forum ‘Newspaper’ is closed to new topics and replies.