Viewing 11 replies - 1 through 11 (of 11 total)
  • Ismail

    (@elhardoum)

    Hi!

    Go to your child theme files ( i see you already have a child theme ), add a new file :

    category-{slug}.php – If the category’s slug were news, WordPress would look for category-news.php

    https://codex.wordpress.org/Template_Hierarchy

    name the file : category-toopakkumised.php and copy the entire code found in cateogry.php file, and remove only the a html tag, I think it is contained in <h2 class="entry-title">..

    Edit: I checked your theme, it does not have category.php file, so simply copy and paste code found in content.php and get rid of this line :

    <<?php pinboard_title_tag( 'post' ); ?> class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></<?php pinboard_title_tag( 'post' ); ?>>

    Don’t forget, feed-backs 🙂

    Thread Starter taavi_miku

    (@taavi_miku)

    Hi Samuel!

    Thanks for your advise! I did as you suggested. Unfortunately it change nothing. But changing the php file name to a category specific category-loppenud_konkursid.php (finished jobads) affected the outcome, but unfortunately not in desired way – the category page showed only one post title with featured image, no any background or whatsoever.

    I explain what I did. I copied the original theme (Pinboard) content.php file, as there wasn’t any under the child theme, removed the line you referred, saved as category-loppenud_konkursid.php and uploaded it under my child theme (Pinboard-child). The original content.php I left as it was.

    As a result I want in one category display posts (active job ads) as it is by default and in other category (finished job ads, called loppenud_konkursid) to show only titles with featured images without links to open post.

    Any thoughts?

    Ismail

    (@elhardoum)

    Hello.

    So, I have downloaded your theme already, and installed it on a live site I manage. so basically here’s the fix to your issue ( follow the steps ):

    Step 1:

    – In your child theme, create a file named category-loppenud_konkursid.php and throw this code in ( index.php edited code ): http://pastebin.com/cBUc9mte

    Step 2:

    – In your child theme, create a content-child.php file, and throw this code in: http://pastebin.com/qMEKawQ7

    Step 3:

    I don’t think there is step 3, just save everything and keep us posted if it worked.

    P.S: the code in step 2 will not show the post excerpts, I thought you needed that, in case you don’t, just get rid of // ( comment ) in line 20 <?php // the_excerpt(); ?>

    Thread Starter taavi_miku

    (@taavi_miku)

    Thank you Samuel! You were most helpful! Your instructions were easy to follow and modified code worked well – the outcome is as I wished. Can you refer me your Paypal account? I want to make up you couple of beers.

    Ismail

    (@elhardoum)

    Not a problem, I am just glad to see it worked.

    Considering that I am very new to PHP ( thanks to these forums I have learnt a lot ), I wouldn’t accept that, I thank you for your generosity and kindness !

    Still, I went to your page I saw that there 2 posts that don’t have a thumbnail, so you might want to set up a default fallback image to display in case the post has no thumbnail fixed. ( because without a thumbnail there will be no clickable link to the post )

    Therefore, you can update content-child.php code with this one:
    http://pastebin.com/gxZJhNmG

    Don’t forget to edit the default image src which is ( http://bhsolutions.eu/wp-content/uploads/2013/09/BH_h250.png, set up your fave )

    Unless, you are going to edit the posts with missing thumbnails, and set them up.

    ^ samuel

    Thread Starter taavi_miku

    (@taavi_miku)

    Thanks for you continuing support and advise, Samuel!
    I discovered just now, on your reply, that thumbnail images has links to whole post. Actually I don’t want that. I don’t want that posts can be opened in that category. It should carry only informative feature – only titles with featured image. So, how I can get rid of linkage?

    Ismail

    (@elhardoum)

    Ah right.. I now understand: you don’t want anyone to read the entire post if listed under that category ?

    Okay – again update content-child.php: http://pastebin.com/Zyqkzett

    You’re welcome 🙂

    Thread Starter taavi_miku

    (@taavi_miku)

    That’s right Samuel! I updated content-child.php file. Now it not linked to a post but only the ones which has my company’s logo as thumbnail. Others are still linked to post through the image link. There should be no difference what featured image there is shown. Can you help me over that? 🙂

    Ismail

    (@elhardoum)

    Hi Taavi!

    Sorry if I put you through this all, I didn’t notice the thumbnail function calls some html inside functions.php file lol.

    There will be no linked thumbnails now, promise ! : content-child.php -> http://pastebin.com/PLrLVxaW

    🙂

    Thread Starter taavi_miku

    (@taavi_miku)

    Now it’s alright! Thank you alot, Samuel! You are pro!

    Ismail

    (@elhardoum)

    haha appreciate it, Taavi! anytime!

    Enjoy your day, and happy blogging on WordPress 🙂

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How do show only post titles and featured image of post in specific category?’ is closed to new replies.