I am facing some problem in WordPress Comments template
In my WordPress I can see the comments template after every post but I don't want to see the headings like you can also use HTML tags.
So how can I remove that lines ?
Simply you need to put this code in comments.php page in you project
check comment_form(); in that page & replace that code with this one
comment_form( array( 'comment_notes_after' => ' ', ) );
Related
I formerly used a Wordpress theme where users could make comments on items I posted and also could make replies on comments made by other users on my Wordpress site.
I later changed my theme on Wordpress and I used a callback in my comment list in comment.php like this:
Then I coded the comment list form in my functions.php, and later noticed that when a user clicked the "reply" button below a comment, the page only reloaded but the comment reply is not working.
Please I really need help to resolve this. This is how I coded my "reply" form in my functions.php: $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
Please is there any way I can resolve this? I will appreciate a reply... Thanks
Check if comment-reply.js is loaded on the page.
EDIT:
This should be already included in your theme's template files that handles the comment feature. View the page source to see if its included, if its not included then to include the this file. Goto functions.php and add this code.
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
In one theme (FloZo) I've seen a nice functionality and I would like to learn how to make something similar. It's about a portfolio page, take a look at the demo "Our Work section".
You create a page and give it a template (Work archive) via Pages menu - more or less understood
You don't add any pictures there!
In your Dashboard you have a nice "work" section, where you can choose "make a new work item" - you add pictures with titles and descriptions there. - This is the big trick!
Now: my newbie idea on how it works:
The template is just the "body" of the page with the title
The dashboard "work" section must be doing something like this:
When you post a work item, it pastes/appends the whole item code into your page (like an item template code) with your specific image and text. It also creates an item-specific page (it's where you end up after clicking on an item).
My question is: is there any slightest possibility to add such a functionality to a Wordpress theme?
Here is how I see it:
The page template, 'Work Archive' has the loop that is displaying posts of 'Work' post type.
So to achieve this first you have to add the custom post type of your liking, and then in the page template add a custom loop to display these:
<?php
$args = array(
'post_type' => 'your_post_type',
'posts_per_page' => -1 //or whatever you choose
);
$work_query = new WP_Query($args);
if ($work_query->have_posts()) : while ($work_query->have_posts()) : $work_query -> the_post(); ?>
<!-- loop content goes here -->
<?php
endwhile;
endif;
wp_reset_postdata(); // always reset post data after custom loops
?>
If you need more info pleae don't hesitate to ask.
Happy coding!
I'm a wordpress newbie here so please go easy on me.
I am working on a wordpress site and I've run into two problems I just can't seem to find the answer to anywhere. I have permalinks set up on my wordpress site, along with paging, so for example, www.mysite.com/links/page/2 sends you to the second page of links.
I just created a custom template that pulls in two different taxonomies with the same tag name. To do that I created a page called tags that uses my custom template and I have a custom link that goes to it with a structure of: www.mysite.com/tags/?tag=mytag This is ugly but it works for testing purposes.
The problem happens when I go to page two and the link is: www.mysite.com/tags/?tag=mytag/page/2 which doesn't work.
I don't want to mess up my current permalinks, but I want to add a new rule that a) stops the page from breaking, and b) actually looks good. I would like to have the link just be www.mysite.com/tags/mytag/page/2
After a ton of digging I was able to get what I thought was the right code. This is what I've added to my functions.php in my theme directory:
add_action( 'generate_rewrite_rules', 'my_tag_rewrite_rules' );
//add_filter( 'query_vars', 'my_tag_query_vars' );
function my_tag_query_vars( $vars )
{
// $vars[] = 'tag'; // might not need this because 'tag' should already be registered
}
function my_tag_rewrite_rules( $wp_rewrite )
{
$wp_rewrite->rules = array(
'tags/([^/]+)/page/?([0-9]{1,})/?$' => $wp_rewrite->index . 'tags/?tag=' . $wp_rewrite->preg_index( 1 ) . '&paged=' . $wp_rewrite->preg_index( 2 ),
'tags/([^/]+)/?$' => $wp_rewrite->index . 'tags/?tag=' . $wp_rewrite->preg_index( 1 )
) + $wp_rewrite->rules;
}
(I commented out the add_filter part because 'tag' was already a query variable wordpress recognized). From what I read it looked like all I needed to do was go into the wordpress dashboard and go to settings->permalinks and supposedly it would change the .htaccess. It didn't.
My first question, is: is my rewrite rule correct? and secondly, what else do I need to do to get wordpress to update the .htaccess file?
Thanks a ton for any help!
In my wordpress plugin, I want to generate a page on the fly.
I could have the user create the page for me. But I would rather not have them do any steps. Just let them activate it and it works.
So I was wondering is there a way for me to do this, which maintains all the functionality within the plugin.
My initial idea was to add a rewrite rule
add_rewrite_rule('my_page/$', 'wp-content/plugins/my_plugin/page.php', 'top');
Then in my plugin I can have a page.php. Which works well, but I cannot get the header/footer etc.
I am very new to wordpress, so chances are i am missing somethign obvious.
You could create a 404 page code snippet that does wp_insert_post() and then redirects the user to it.
Your theme's 404.php would look like this:
<?php
$post_id = wp_insert_post("post_title" => "my post title", "post_content" => "Lol");
header("location:" . get_permalink( $post_id ) );
die();
?>
I would love to kinda replicate WordPress post/page text editor (Admin panel) in comments section. That's how site users will be able to format text easily. A good example of what I actually need can be found here at StackOverflow when someone is about to Ask Question.
In your functions.php, add the following snippet:
add_filter( 'comment_form_defaults', 'tinymce_comment_4265340' );
function tinymce_comment_4265340 ( $args ) {
ob_start();
wp_editor( '', 'comment', array('tinymce') );
$args['comment_field'] = ob_get_clean();
return $args;
}
It's working on WordPress 3.5 and Twenty Twelve theme.
The TinyMCEComment WordPress plugin could help you out. It uses the internal TinyMCE editor (bundled in WordPress 2.0 and up).
Try this tutorial. It worked for me. The above answer might add TinyMCE to the reply section. The tutorial shows how to fix that.