How to add comments to a WordPress theme - wordpress

How can I add comments to my WordPress theme. I tried <?php comment_form(); ?> but it doesn't give any output. Am I missing something?

Just add the following line
<?php comments_template(); ?>
inside your single.php where you want to add/display the comments template. This will add/include the comments.php file in the single template and make sure that comments.php is also available in your theme folder.
Also you can use Disqus wordpress plugin, it's a very nice plugin.
References: Codex and a tutorial.

Related

Wordpress: How to add comment for taxonomy page

I need to add comments for taxonomy page. I would like to know if it is possible.
Thanks for help.
Michal
It's definitly possible :) Just put <?php comments_template(); ?> in the place you want your comments to appear.
If you haven't already, create a template for your taxonomy archive (just copy the contents of archive.php), and call it taxonomy-{taxonomy_slugname}.php or taxonomy.php. This is where you put <?php comments_template(); ?>.

Wordpress setting custom Frontpage

how can I make a link that is coming from a plugin the frontpage
ex: /wp-content/plugins/documente/documentations/medias_v4/index.html
or
ex: /?p=5
In your active theme, make a file called front-page.php or edit an existing one. In it, add a line in the beginning: <?php include '/wp-content/plugins/documente/documentations/medias_v4/index.html'; exit; ?>

How to use wordpress shortcode in template

I need help with wordpress shortcode. I have written shortcode function in functions.php in my theme files. Now I create page in wordpress administration and then I need to place this shortcode into special place in my theme but with content which I wrote in administration.
I hope that you understand what I mean.
Thank you for your help.
In your template code:
<?php echo do_shortcode('[your-shortcode]'); ?>
Replace [your-shortcode] with whatever your shortcode is, including parameters/attributes and/or closing tags if required.

creating wordpress template

I need to create a fresh wordpress template using adobe dreamweaver . I want the template with image slider , stylish menus and commenting options. please guide me from basic to end.
Maybe you'll find this tutorial helpful:
http://www.adobe.com/devnet/dreamweaver/articles/dw-wordpress-multiscreentheme.html
as well as this:
http://www.adobe.com/devnet/dreamweaver/articles/dw_wordpress_pt1.html
Wordpress Template starts with
<?php /* Template Name: Stylish Template */ ?>
<?php get_header(); ?> // go to header.php add required js file for slider & menu through wordpress function() <?php wp_nav_menu($args); //check wordpress documentation for $args.
<div id="slider">
--images will go here
</div>
<div id="content">--Content Goes here---These will be posts from any category or latest posts, look wordpress documentation for <?php comment_template() to add comments if they are disabled.?></div>

Enable shortcodes in a wordpress theme

I develop a new theme for wordpress 3.3.1 from scratch and shortcodes are not working on it.
As I searched until now it is a matter of filtering the content containing the shortcode, filter code added in a theme specific location(shorcodes are working with another theme).
So, my question is : What is the code for a general shortcode theme enable ?
To execute a single shortcode, run it with
echo do_shortcode('[your_short_code]');
If the shortcode(s) are in the post content, make sure you're displaying it with
<?php the_content();?>
Or
<?php echo apply_filters('the_content',$post_content);?>
Or
<?php echo apply_filters('the_content',$wp_query->post->post_content);?>
The important thing is: if you aren't using the function "the_content()" you need this line <?php echo apply_filters('the_content',$wp_query->post->post_content);?> where in the second argument you have to put the variable of the post content you want to show.
I had to save the theme's content to a variable and then use the second example.. Worked like a charm.
$mycontent = ot_get_option('rightcontent');
echo apply_filters('the_content',$mycontent);

Resources