- This topic has 6 replies, 2 voices, and was last updated 4 years, 1 month ago by David.
-
AuthorPosts
-
August 10, 2020 at 6:34 am #1395346Michael
I hope you can help me, getting nowhere fast at WP download manager support. When I list categories of downloads (in reality custom post types) the title of the category isn’t displayed, nor the description. This is if I use their global “template” if I use their custom template (which allows styling of the download titles (post titles)) I still don’t get a title or description for the category page. The only way I can get a title and description is by using their “do not apply” template option. Which reverts to the generatepress method which gives me what I need.
I’ve been back and forward with them trying to explain the problem. It’s pretty standard I would’ve thought to display a title of a page and description. All they’ve suggested is I customise the template, but all that does is style the links and not the title or description, or give any option to show those.
Finally today they offered something to add to the functions.php file.
add_action("wpdm_before_category_page_content", function ($cat){ ?><h2><?php echo $cat->name; ?></h2><?php });
I’m no php expert but that doesn’t look right. It does however give me a page title for the categories at least, but not a description.
Back to Generatepress, I saw a solution in these forums for echoing a category description using an element, unfortunately I can’t seem to get the php file editing to be allowed to use that function. I saw another post where it created a shortcode here. So I added the function to create the shortcode, then added that to the element ticking the box, and specifying where it should go. Nothing happened.
It’s been really frustrating to get what in reality is basic functionality
The website link I’ve added is to show you an example page of what I’m getting at the moment. I realise it’s 3rd party software, but I thought there may be some way in Generatepress to get what I’m after, other than using the default blog post layouts.
August 10, 2020 at 7:41 am #1395442DavidStaffCustomer SupportHi there,
within that Hook function they provided you can try calling the
category_description()
eg. this line after the $cat->name line.
<?php echo category_description(); ?>
August 10, 2020 at 7:46 am #1395447MichaelThanks David.. really pulling my hair out with them over this. They’re blaming GP theme, but if I don’t use their “templates” then GP does show title and description.
“Default category pages are mostly controlled from the theme, and most themes show category title by default. But, as generatepress is not showing category title for default category page when using custom template”
Be interested to know if it is GP which I doubt that’s the issue.
August 10, 2020 at 7:49 am #1395536MichaelOh and thanks, that works like a dream. Would be nice to get it to only activate if it was in that area ie in an element where location could be specified. Am not quibbling though, it works and it stops me going crazy.
August 10, 2020 at 8:03 am #1395615DavidStaffCustomer SupportThere not wrong in regards to category template – GP uses the archive template.
If it works – then don’t change it 🙂You can of course use a Hook Element.
<h1><?php single_cat_title(); ?></h1> <p><?php echo category_description(); ?></p>
Then select Hook > Custom Hook and add
wpdm_before_category_page_content
to the field.
Check execute PHP and set your Display Rules.August 10, 2020 at 8:07 am #1395626MichaelThanks again David, I’ll do that once I work out why I can’t execute the PHP because file editing disallowed. Changed to false in wp-config but still saying not allowed, once I find the culprit for that I’ll do it via elements.
August 10, 2020 at 4:04 pm #1396244DavidStaffCustomer SupportCheck if you have any security plugin settings blocking it or Mod-sec server rules.
Glad to be of help.
-
AuthorPosts
- You must be logged in to reply to this topic.