Forum
Duplicate blog post title
I'm new to Perch, but so far loving it and it's quite easy to get a handle on.
I do have one issue on my /blog/post.php page. There are 2 post titles. The top title is coming from <?php perch_blog_post_field(perch_get('s'), 'postTitle'); ?> and the lower one is coming from the blog post itself.
I've been following the videos to get up and running and I added the 'postTitle' as suggested in the video. My question is, how do I get rid of the second post title, which also has a link attribute?
Have I messed something up, or do I need to edit a template? I was reluctant to just start editing things. I'd also like to add that I've searched the forum to see if anyone had a similar issue.
Here are my settings
Perch: 3.1.3, PHP: 7.2.12, MySQL: 10.1.36-MariaDB, with PDO
Server OS: Linux, litespeed
Installed apps: content (3.1.3), assets (3.1.3), categories (3.1.3), perch_blog (5.6.1)
App runtimes: <?php $apps_list = ['perch_blog' ];
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/egginton/public_html/test1.egginton.org/perch
PERCH_CORE: /home/egginton/public_html/test1.egginton.org/perch/core
PERCH_RESFILEPATH: /home/egginton/public_html/test1.egginton.org/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 50M, Max POST 50M, Memory: 128M, Total max file upload: 50M
F1: 3b606135b33e6a102526838f4152a807
Resource folder writeable: Yes
HTTP_HOST: test1.egginton.org
DOCUMENT_ROOT: /home/egginton/public_html/test1.egginton.org
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Can you post the code for the page and the post.html template?
Thanks for replying Clive.
Here is the post.html template:
And here is the page code:
Thanks
By page code, I actually meant the source code not the output. No problem though. You will need to edit the page's code to remove the duplicate title, presumably that's the code that generates this
<h1 class="text-left " >Test Blog</h1>
. You say in your first post that this is generated by<?php perch_blog_post_field(perch_get('s'), 'postTitle'); ?>
. You won't need that if you are using thepost.html
template to display the post.Thanks again Clive for your reply.
It makes sense to remove the <?php perch_blog_post_field(perch_get('s'), 'postTitle'); ?> part as it's creating the duplicate, but the post title that's part of the post.html template is a link. I can understand it being a link on the main blog page, but once I'm on the post's post.php page I'd expect it not to be a link. Is there a way to stop that?
Thanks
You can edit the
post.html
template or create your own template to display blog posts. If you do this, there's information ("Editing Templates") here https://docs.grabaperch.com/templates/apps/blog/ about the location of new templates.Thanks Clive