how to add a search box to forum in wordpress - wordpress

I have configured, wordpress forum. I have created several forums in the site.
Everthing is fine but there is no configuration to search previous form topics.
I use bbPress forum.
I have tried following but didnt see any difference.
<div class="bbp-search-form">
<?php bbp_get_template_part( 'form', 'search'); ?>
</div>
I added above code to content-single-forum.php file

Try below code:
<?php get_search_form(); ?>
Thanks.

Related

Wordpress - theme doesn't show newest posts

I have a website with Wordpress and free template Creative on this link: http://kristinauhrinova.com.cluster3s23.dnsserver.eu/
I don't know why, but on bottom of the home page it doesn't show previews of newest added posts like in template demo http://dessign.net/unittheme/
Can you help?
Thanks, Filip.
Looks like there is no loop in the index.php. You may have to write one yourself. To pull the previews if one doesn't already exist. Here's the WP Codex page about The Loop. Hope this helps.
try to add this code on the home page,
<?php the_title(); ?><br />
<?php the_content(); ?>

Buddypress Plugin Theme error

This is with respect to a buddypress addon (plugin) whose theming I am unable to do. I searched many sites but unable to get a concrete solution. In the plugins page, Header is getting disturbed if its a buddypress theme but is working fine in default wordprress themes.
I am using this code at present at the top of the template page
<?php get_header('buddypress'); ?>
<div id="buddypress">
<div id="profile">
<div class="row">
Than the following stuff like
<?php do_action( 'bp_before_member_home_content' ); ?>
<div id="item-header" role="complementary">
<?php bp_get_template_part ( 'members/single/member-header' ) ?>
</div><!--#item-header-->
I feel this is not the right way to do. I want to know if the plugin has to copy the buddypress template header without disturbing footer or sidebar how it can be done. i.e my plugin should show only the plugin content and should not disturb any part of the buddypress template.
you have to edit your buddy press header with your html structure.
and keep buddy-press functionality as it is.

Basic Fishpig Wordpress Integration - Display Custom Post on Homepage

I'm trying to create a slider on the homepage of my Magento site. I am totally new to Magento and have someone else on our team coding most of that stuff after realizing how far into the deep end I jumped.
My issue: I'm trying to pull custom posts from WP (with the paid advanced custom fields extension) to display an image that will go into a slider.
I'm stuck at the most basic part - pulling in a list of Wordpress posts.
I created a new file: mytemplatedirectory/default/template/home/slider.phtml with
<?php $posts = $this->getPosts() ?>
<?php foreach ($posts as $_post) : ?>
<?php echo $post->getPostContent() ?>
<?php endforeach ?>
and I put this into the CMS page in the Magento admin:
{{block type="core/template" template="home/slider.phtml"}}
But not even the default post is showing up.
If anyone has any guidance that would be extremely helpful. The beginning steps are what are throwing me off but it would also be nice to have help pulling the custom post and the advanced custom field (although it seems that Fishpig's documentation makes this pretty simple).
Thanks in advance! Sorry for such an amateur question.
The block type you're using does not include the getPosts() method, which is the reason your call to this returns nothing. If you change the block type to 'wordpress/sidebar_widget_posts' then the call to getPosts will return a post collection object.
The following link explains a little bit more about how to include this block and what you can do with it:
Display WordPress Blog Posts on the Magento homepage
Figured this out with Ben's help (who I believe is the creator of the excellent Fishpig extension).
I created a custom post (with the Custom Post Type UI plugin for WP) and a custom field (with the Advanced Custom Fields plugin for WP).
On my Homepage in the CMS I added in the content area
{{block type="wordpress/sidebar_widget_posts" name="wordpress.widget.recent_posts" post_count="5" post_type="slider_home" template="wordpress/sidebar/widget/slider_home.phtml"}}
In that block, slider_home is my post type and slider_home.phtml is a new file I created that pulls the code from wordpress/sidebar/widget/posts.phtml but customizes it to my need.
Within the loop in slider_home.phtml I took out what was currently there and added:
<?php $image = $post->getMetaValue('image'); ?>
<?php $url = $post->getMetaValue('url'); ?>
<a href="<?php echo $url; ?>" target="_blank">
<img src="<?php echo $image; ?>" />
</a>
which is pulling in the custom fields I made in Wordpress. works perfectly and now my client will be able to update their Magento site through the Wordpress CMS.

Disqus comment form not displayed on self hosted Wordpress site

I have followed all instructions on installing Disqus commenting system on my website but the old comment form is still visible.
My question is: is <?php comment_form(); ?> enough to display the comments or there needs to be something else on the single.php page.
What else should I be taking care?
I don't have any other commenting engine installed.
Thank you
OK I found it.
Instead of using the <?php comment_form(); ?> I had to use <?php comments_template(); ?>.
That did the trick
install woody snippets on your site
insert a new php snippet:
comments_template(); ?>
go in widget select custom html and place the code:
<div id="disqus_thread">
[wbcr_php_snippet id="THE ID WHAT WOODY GAVE YOU"]
</div>
and place the widget where you want
obviously don't forget to enable comments site-wide

Wordpress - Post Page Associator Issues

For a client site that I am working on, the client wants to be able to associate certain custom post types to a given page. my supervisor has pointed me to the website of a previous client that did something similar. They used the Post Page Associator plugin (which seems to have been removed from the plugins list).
Here is a link to the plugin I am using: http://www.mediafire.com/?2dpbxac73rsn8l6
I've tried my best to modify the code inside the plugin to handle the custom post types I wanted to use (which the changes are included in the download). The main conflict comes from this piece of code (from the previous client's page.php file)
<?php
$sidebar = new WP_Query( $args ); //queries for posts
$sidebar = wp_plugin_post_page_associator::get_associated_posts ($post->ID); //looks for associated posts via the plugin, the main offending line of code
if ($sidebar!="") : while ( $sidebar->have_posts() ) : $sidebar->the_post();
?>
<div id="sidebar-content"> <!-- sidebar area -->
<h1 class="blue-text"><?php the_title(); ?></h1> <!-- the title of the associated post -->
<div class="divider"></div>
<?php the_content(); ?> <!-- the content of the associated post-->
<br/><br/>
</div>
<?php endwhile; else:?>
<br/><br/>
<?php endif; ?>
I was wondering if there was a way to determine what kind of post type the associated content is so I can change the WP_Query settings accordingly. If I comment out the second line of code with $sidebar, then all posts gets displayed in the sidebar. Is there a solution to this problem, or is there a better plugin for this?
I found a replacement plugin that does exactly what I need and shows me how to do it: http://www.cssigniter.com/ignite/custom-post-types-relationships/

Resources