-
AuthorPosts
-
October 10, 2016 at 11:21 am #697220
Hi,
I’ve been looking at the latest version of enfold and must admit I like it a lot more than the previous – so, well done.
I have a custom post type which I use, and I have adapted the original archive and loop-index files to display them. All if fine except that I want to display ONLY the image, meta, and title, but NOT the excerpt on this template. Looking at the code I cannot see what I would need to do to hide excerpts (I know I could do it with CSS but I prefer to simply not have it output).
How can I do this? Which bit do I need to remove to stop the excerpt being shown? I’m using the grid layout.
Thanks
October 11, 2016 at 5:15 am #697603Hi brian7454!
Thank you for using Enfold.
Could you please provide a link to one of the archive pages? You can try this code:
.archive .slide-entry-excerpt { display: none; }
Regards,
IsmaelOctober 11, 2016 at 10:21 am #697713Hi,
Yes, I know I can use css, as I said in my post, but I was hoping to remove it from the template rather than just hide it. I’ve been looking again and although I set up an alternative ‘includes’ folder and added a custom named ‘adoptsloop-index file, no matter what I do I can’t shift the content without css. I even tried deleting the content – it can be shown via a custom field elsewhere – but that then caused the post date meta to vanish too.
In fact, I suspect that the child custom loop file isn’t working anyway — though I can show that the custom archive file I created for the purpose is working. Its odd. I can and have customised the single post page without any issues, adding custom fields and so on, but the custom archive file won’t play ball. I’ve tried adding fields and even breaking the php to see what happens, but it seems not to work. In my custom archive template I have this – extract –
else
{
get_template_part( ‘includes/advertsloop’, ‘index’ );
}
}
else
{$more = 0;
get_template_part( ‘includes/advertsloop’, ‘index’ );
}This should cause the archive template to use advertsloop-index.php, (in the child ‘includes’ folder) shouldn’t it?
For some reason it won’t…
Maybe that’s why I can’t find how to not display the content?I know you don’t help with custom bits, and I’m not asking you to, but this would be how to set up a custom archive page, no?
Or is your archive behaviour different to single posts? Odd, I never came across this before.October 12, 2016 at 3:49 am #698142Hi!
Did you create an archive template (ex: archive-cpt.php)? https://codex.wordpress.org/Post_Type_Templates
Cheers!
IsmaelOctober 12, 2016 at 12:11 pm #698209Yes, of course. Also taxonomy templates.
For example:
archive-adoptions.php (adoptions is the name of the cpt, and this is in the child theme folder)
additionally;
taxonomy-pettypes-cats.php
taxonomy-pettypes-dogs.php
taxonomy-pettypes-other.php
taxonomy-pettypes.phpAll of these are edited so that instead of showing:
get_template_part( ‘includes/loop’, ‘index’ ); (which I believe is the file that creates the individual posts shown in the lists)
I have:
get_template_part( ‘includes/archiveadvertsloop’, ‘index’ );Yet the custom loop file just never seems to be active – only the default. I can’t work out why….
October 12, 2016 at 12:32 pm #698212Should have said, I then have a file called archiveadvertsloop-index.php in the child ‘includes’ folder.
That’s the one that seems not to work if I try to edit it – no matter what I do, nothing changes. I wondered if maybe I was missing something?October 16, 2016 at 5:26 am #699443Hi!
The file name (archiveadvertsloop-index.php) is invalid. It should be archive-cptname.php. And inside the archive file, you should have this line.
get_template_part( 'includes/loop', 'index' );
You have to change “index” with the actual name of the loop file. If you have a file called “loop-adoptions” inside the includes folder, change it to:
get_template_part( 'includes/loop', 'adoptions' );
Regards,
IsmaelOctober 16, 2016 at 10:03 am #699494Hello,
The name archiveadvertsloop-index.php is not a CPT template file. Inside your default archive.php there is reference to the loop-index.php file. In all the themes I currently use, this would be the file which provides the loop to fetch and display posts on the custom archive template, and at least with avada which I use often, I can rename it in the way I had done here. Obviously it’s different with Enfold.
The modified archive file I am using is called archive-adoptions.php and includes/included the line:
get_template_part( ‘includes/loop’, ‘index’ );
which I assumed built the posts.From what you say, my renaming attempt was wrong, so that’s my fault. I was copying practices used with other themes I’m familiar with, but obviously Enfold’s files do different things.
The reason I was trying to modify things was that I wanted to be able to do was add the word ‘posted’ in front ot the date meta, and ideally create and position a button connected to the post permalink with the words ‘read more’. It’s so childishly simply in most themes, but in Enfold I simply cannot see where the output comes from in order to modify it!
My question then, as I want to modify something, is where is the $blog output created? What file do I need to look at?
Thanks for your help.
- This reply was modified 8 years, 2 months ago by brian7454.
October 19, 2016 at 4:54 am #700977Hi,
Since you’re using the grid layout, the output is rendered by the config-templatebuilder > avia-shortcodes > postslider.php file. If you’re using any other blog style, you can just modify the includes > loop-index.php file. You can see it in the archive.php file.
$blog = new avia_post_slider($atts); $blog->query_entries(); echo " <div class='entry-content-wrapper'>".$blog->html()."</div> ";
Best regards,
IsmaelOctober 19, 2016 at 10:20 am #701097Thanks for that.
October 20, 2016 at 6:32 am #701650 -
AuthorPosts
- You must be logged in to reply to this topic.