Re-skinning or Re-templating
-
I love the CommentPress-core plugin; but I still want dynamic, widgetized pages on the site which do NOT feature the CONTENTS/COMMENTS/ACTIVITY column. Is there a way to do either of the following?:
- introduce another template which could be selected from the authoring interface;
- insert the CommentPress code on a template compatible with my chosen theme
?
Tips & guidance welcome!
~Brendan
-
Hi Brendan,
I don’t know what your theming skills are like, but you could create a child theme and amend it whichever way you want… There’s a “starter child theme” on GitHub you could use as the basis for your custom theme.
Also, just about everything in the plugin and theme can be overridden via filters and actions, so if you want to override the content of the sidebar on a particular page, you can do it that way too.
Cheers,
Christian
I’ll have another stab at it within a couple weeks. I haven’t worked much with enqueued styles, but have reason to hope I will be able to – enough to find out how to set up a template with a substitute sidebar. (Anywhere in particular I should start?)
A larger goal of mine is to get more dynamic content into the comments – for instance, video and even quizzes. Last try, I did get video in comments to work, but I could not make WP-Pro-Quiz quizzes clickable (maybe due to a javascript or layer issue?).
Thanks for any further pointers before I dive in!
If you download the child theme on GitHub, it does that for you. Have a look at the
functions.phpfile to see how it’s done. Amend to suit your needs.As for replacing the sidebar on a specific page or pages, you can copy
sidebar.phpfrom the default theme into your child theme and add your conditional logic at the top of the file. Along the lines of:global $post; // for some post ID if ( $post->ID == 'some post id' ) { // include your custom sidebar - point to wherever you put it include( get_stylesheet_directory() . '/assets/templates/your_custom_sidebar.php' ); // kick out of the rest of the file return; }Hope that helps,
Christian
BTW, you may need to include some of the sidebar markup structure, or else the javascript could throw errors.
I’ll think about ways of making this easier in the future.
Cheers,
Christian
Thanks so much for this response. I’ve worked with the child theme, and thrown css switches with some success. But I am not sure my theming and scripting skills are up to the task of integrating “everything else on my site” around the CommentPress machinery.
For me, the ideal CommentPress would function inside My-Chosen-Theme – working its magic inside the div#content element using a single-column template. Perhaps CommentPress would be invoked for every page/post/doc with a certain category or tag.
I’ll report back any surprise successes, though. Thanks much again!
@doclalor: this was initially how CommentPress worked – or tried to work. It used to create a Javascript-generated comment box from the markup of the “host” theme. Unfortunately, it became unviable because of the variety of markup in different themes. And because the JS-only approach made it impossible to comply with accessibility guidelines. I think Digress.it (which forked from CommentPress way back when) still works this way, though I’m not sure how actively maintained it is.
I can understand that you’d like a “CommentPress-ified” section to your site, but the only solution I can think of right now would be to use Multisite, where your theme is applied to the main site and CommentPress is enabled on a subsite where you want its functionality. You could then use the Theme Customizer to give CommentPress a similar colour scheme and graphic identity to your main site.
Cheers,
Christian
Christian, that is a great suggestion and what I’ll likely end up doing. Thanks much!
Hi CommentPress
Congratulations for this cool project.
I am working on a site in spanish, and
have two, actually three questions:The site is at http://ideas.centroamerica.tv
(1) Youtube videos show up, but do not play. Have You heard of such trouble ? Is there any suggestion, as where to start looking for a solution?
(2) TAGS: It would be great to tag pages and comments alike. In case there is a solution ready, which works with CommentPress, I would appreciate a hint.
(3) Spanish language: I looked for a translation file, but without luck. Please give me a hint if there is any spanish project. In any case, it will be a pleasure, but very slow, to contribute some translations were needed.
Congratulations and meny thanks again.
Best regards out of sunny Costa Rica π
Roland
Hi Roland,
(1) your YouTube videos work just fine here. Perhaps there’s something about your computer that prevents them from playing?
(2) Sorry, but I’ve no idea. If you do come across a plugin that does these things, I can make sure CommentPress is compatible with it.
(3) You can find the base translation file in the plugin directory
languages/commentpress-core.pot. Unfortunately, there is no Spanish translation file – but any contribution towards one would be gratefully received.Best wishes from snowy England!
Hi
Is there a way to use this plugin only in certain pages and keep my theme?
Thanks
RaniHi jabcka,
No, that’s not possible at present. A previous solution has been to use multisite and install CommentPress on a sub-blog. You may be able to cunningly switch theme for a particular post, but I can’t say how that would pan out.
Cheers,
Christian
Thanks
The topic ‘Re-skinning or Re-templating’ is closed to new replies.