Struggling with installation
-
Hi
I’m trying to create this using method 2 (I don’t want the homepage to be a dating site, only a section of the site) but I’m struggling to understand the instructions.
I have created a page at https://www. the house of dog .co.uk/dog-assisted-dating/ and have added an arbitary widget there with the code;
<?php if(!function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘my-area-name’)) : endif; ?>
I’ve set the page at rencontre > General > Page where is settled the plugin; to the Dog assisted dating page.
I’ve added the rencontre widget I found in my widgets section to this same page too, but still nothing happens.
I’m probably doing everything wrong, is there a video tutorial somewhere please?
Thanks
-
Method with widget is more complicated.
You need to create the widget area in function.php if existing one isn’t good.
You need to add this widget area in a page template.
Then, you can drag and drop the Rencontre widget in this new widget area.Hi Jacques
Thanks for getting back to me.
The code in my function.php at the moment is;
<?php /** * Register our sidebars and widgetized areas. * */ function arphabet_widgets_init() { register_sidebar( array( 'name' => 'Home right sidebar', 'id' => 'home_right_1', 'before_widget' => '<div>', 'after_widget' => '</div>', 'before_title' => '<h2 class="rounded">', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'arphabet_widgets_init' ); if ( function_exists( 'register_nav_menus' ) ) { register_nav_menus( array( 'footer-nav' => __( 'Footer Navigation',TEMPLATE_DOMAIN ), ) ); } function my_custom_tax($taxonomy='', $args='') { // cast $taxonomy as an array so in_array() always works. if( in_array('listing_category', (array) $taxonomy) ) { return array('listing_category'); } elseif( in_array('classifieds_categories', (array) $taxonomy) ) { return array('classifieds_categories'); } return $taxonomy; //Wasn't us so pass original. } add_filter('show_admin_bar', '__return_false'); add_filter( 'get_categories_taxonomy', 'my_custom_tax' ); add_filter( 'mp_register_post_type', 'add_mp_custom_fields' ); function add_mp_custom_fields($args) { $args['capability_type'] = 'products'; return $args; } // custom admin login logo function custom_login_logo() { echo '<style type="text/css"> h1 a { background-image: url('.get_bloginfo('template_directory').'thehouseofdog.co.uk/wp-content/uploads/2014/01/Thehouseofdog-logo-reduced-e1397132606913.jpg) !important; } </style>'; } add_action('login_head', 'custom_login_logo'); function geodir_restore_default_pages() { //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' ); geodir_restore_default_page( esc_sql( _x('listings', 'page_slug', GEODIRECTORY_TEXTDOMAIN) ), 'geodir_listing_page', __('All Listings', GEODIRECTORY_TEXTDOMAIN), '' ); geodir_restore_default_page( esc_sql( _x('add-listing', 'page_slug', GEODIRECTORY_TEXTDOMAIN) ), 'geodir_add_listing_page', __('Add Listing', GEODIRECTORY_TEXTDOMAIN), '' ); geodir_restore_default_page( esc_sql( _x('listing-preview', 'page_slug', 'geodirectory') ), 'geodir_preview_page', __('Listing Preview', GEODIRECTORY_TEXTDOMAIN), '' ); geodir_restore_default_page( esc_sql( _x('listing-success', 'page_slug', GEODIRECTORY_TEXTDOMAIN) ), 'geodir_success_page', __('Listing Success', GEODIRECTORY_TEXTDOMAIN), '' ); geodir_restore_default_page( esc_sql( _x('location', 'page_slug', GEODIRECTORY_TEXTDOMAIN) ), 'geodir_location_page', __('Location', GEODIRECTORY_TEXTDOMAIN), '' ); } function geodir_restore_default_page( $slug, $option, $page_title = '', $page_content = '', $post_parent = 0,$status = 'virtual' ) { global $wpdb, $current_user; $page_found = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;", array($slug) ) ); if ($page_found) : // Page exists update_option($option, $page_found); return; endif; $page_data = array( 'post_status' => $status, 'post_type' => 'page', 'post_author' => $current_user->ID, 'post_name' => $slug, 'post_title' => $page_title, 'post_content' => $page_content, 'post_parent' => $post_parent, 'comment_status' => 'closed' ); $page_id = wp_insert_post($page_data); add_option($option, $page_id); } add_action('init' , 'geodir_restore_default_pages') ; add_action('init' , 'geodir_redirect_to_default_login') ; function geodir_redirect_to_default_login() { if(isset( $_REQUEST['geodir_signup'])) { wp_redirect(home_url().'/wp-login.php'); exit(); } } ?>
So I tried to add the code
<?php if(!function_exists('dynamic_sidebar') || !dynamic_sidebar('my-area-name')) : endif; ?>
like this;
<?php /** * Register our sidebars and widgetized areas. * */ function arphabet_widgets_init() { register_sidebar( array( 'name' => 'Home right sidebar', 'id' => 'home_right_1', 'before_widget' => '<div>', 'after_widget' => '</div>', 'before_title' => '<h2 class="rounded">', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'arphabet_widgets_init' ); if ( function_exists( 'register_nav_menus' ) ) { register_nav_menus( array( 'footer-nav' => __( 'Footer Navigation',TEMPLATE_DOMAIN ), ) ); } if(!function_exists('dynamic_sidebar') || !dynamic_sidebar('my-area-name') function my_custom_tax($taxonomy='', $args='') { // cast $taxonomy as an array so in_array() always works. if( in_array('listing_category', (array) $taxonomy) ) { return array('listing_category'); } elseif( in_array('classifieds_categories', (array) $taxonomy) ) { return array('classifieds_categories'); } return $taxonomy; //Wasn't us so pass original. } add_filter('show_admin_bar', '__return_false'); add_filter( 'get_categories_taxonomy', 'my_custom_tax' ); add_filter( 'mp_register_post_type', 'add_mp_custom_fields' ); function add_mp_custom_fields($args) { $args['capability_type'] = 'products'; return $args; } // custom admin login logo function custom_login_logo() { echo '<style type="text/css"> h1 a { background-image: url('.get_bloginfo('template_directory').'thehouseofdog.co.uk/wp-content/uploads/2014/01/Thehouseofdog-logo-reduced-e1397132606913.jpg) !important; } </style>'; } add_action('login_head', 'custom_login_logo'); function geodir_restore_default_pages() { //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' ); geodir_restore_default_page( esc_sql( _x('listings', 'page_slug', GEODIRECTORY_TEXTDOMAIN) ), 'geodir_listing_page', __('All Listings', GEODIRECTORY_TEXTDOMAIN), '' ); geodir_restore_default_page( esc_sql( _x('add-listing', 'page_slug', GEODIRECTORY_TEXTDOMAIN) ), 'geodir_add_listing_page', __('Add Listing', GEODIRECTORY_TEXTDOMAIN), '' ); geodir_restore_default_page( esc_sql( _x('listing-preview', 'page_slug', 'geodirectory') ), 'geodir_preview_page', __('Listing Preview', GEODIRECTORY_TEXTDOMAIN), '' ); geodir_restore_default_page( esc_sql( _x('listing-success', 'page_slug', GEODIRECTORY_TEXTDOMAIN) ), 'geodir_success_page', __('Listing Success', GEODIRECTORY_TEXTDOMAIN), '' ); geodir_restore_default_page( esc_sql( _x('location', 'page_slug', GEODIRECTORY_TEXTDOMAIN) ), 'geodir_location_page', __('Location', GEODIRECTORY_TEXTDOMAIN), '' ); } function geodir_restore_default_page( $slug, $option, $page_title = '', $page_content = '', $post_parent = 0,$status = 'virtual' ) { global $wpdb, $current_user; $page_found = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;", array($slug) ) ); if ($page_found) : // Page exists update_option($option, $page_found); return; endif; $page_data = array( 'post_status' => $status, 'post_type' => 'page', 'post_author' => $current_user->ID, 'post_name' => $slug, 'post_title' => $page_title, 'post_content' => $page_content, 'post_parent' => $post_parent, 'comment_status' => 'closed' ); $page_id = wp_insert_post($page_data); add_option($option, $page_id); } add_action('init' , 'geodir_restore_default_pages') ; add_action('init' , 'geodir_redirect_to_default_login') ; function geodir_redirect_to_default_login() { if(isset( $_REQUEST['geodir_signup'])) { wp_redirect(home_url().'/wp-login.php'); exit(); } } ?>
But it just broke the page, so I went back to the original. Am I doing this wrong? I’m not much good with code as you can probably tell!
Hi Sallysqueak,
- Create the widget area in function.php. It’s OK in your first code.
- Add this widget area in a page template with the right name (not my-area-name). Not in function.php.
- Drag and drop the Rencontre widget in this new widget area.
Take a tour here (it’s in french).
RegardsHi Jacques
Apologies for my stupidness here
So what exactly do I need to do? Create a new item within my themes child folder and call it dynamic-sidebar-function.php and then just add only the code below in it?
<?php if(!function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘my-area-name’)) : endif; ?>
Or am I completely missing the point?
Hi Sallysqueak,
It is better for you to use method 1. Look at the FAQ page, first item.
Widget is interesting only if you add other widgets in the same page.
Regards
Hi Jacques
I was under the impression method 2 is for when the dating site is just an add on to an existing site? I don’t want the dating site as my homepage, i already have a complex site at this domain. I just want the dating site to be a feature on the site so I thought I had to use method 2?
Ok, so looking now at method 1 (although I’m not sure this is the right thing to do for a site which only wants the dating site as a part of the site rather than the entire site being a dating site?)
Assuming I am ok to use method 1, this is what I don’t understand;
copy page.php ; – I have no page anywhere called page.php, all I have is index.php and all that contains is `<?php
// Silence is golden.
`
The only other thing I can find which is a .php file is in my themes child folder called functions.php, the content of this is the code shown further up in this thread.paste it with new name (ex : page-rencontre.php) ;
add the code mentioned in installation para secundo and tertio at the best place, just after content div ; Paste which code, in which .php file, (and call it what?) and place the .php file where exactly?
clean unneeded code ;
in admin panel / page, create or change a page to set page-rencontre as template ;
in admin panel / settings / reading, choose static page and the page you just changed.I’d really like to get this working, but just really need help with the installation. I created the page at https://www. the house of dog .co.uk/dog-assisted-dating/ for the main part of the site, so I’d like to get it all appearing here.
Please could you explain what you mean above? Sorry I’m a bit stupid!
Hi Sallysqueak,
If the child folder is quasi empty, look at the main theme folder. WordPress does.- Copy, paste, modify and rename a page template (page.php if exists)
- Choose this page template in the right page (admin tab page)
That’s it.
I don’t know what else to say.OK,
The new simplest way from now :- Download new version V1.5 (update today)
- Add shortcodes [rencontre] and [rencontre_libre] in your page
Regards
Thanks Jacques
I just started to get my head around it, lol, but then noticed you’ve added these shortcodes.
I’ve added these shortcodes now and I’ve also got this template I think you meant for me to create. The file is now within my themes child folder and is called dog-assisted-dating-page.php
The content within it is;
<?php get_header(); ?> <?php do_action( 'bp_before_content' ); ?> <!-- CONTENT START --> <div class="content"> <div class="content-inner"> <?php do_action( 'bp_before_blog_home' ); ?> <?php if(is_user_logged_in()) { $renc=new RencontreWidget; $renc->widget(0,0);} ?> <!-- POST ENTRY END --> <div id="post-entry"> <div class="post-entry-inner"> <?php do_action( 'bp_before_blog_entry' ); ?> <?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?> <?php do_action( 'bp_before_blog_post' ); ?> <!-- POST START --> <article <?php post_class('post-single page-single'); ?> id="post-<?php the_ID(); ?>" <?php do_action('bp_article_start'); ?>> <h1 class="post-title entry-title" <?php do_action('bp_article_post_title'); ?>><?php the_title(); ?></h1> <?php get_template_part( 'lib/templates/post-meta' ); ?> <?php do_action( 'bp_before_page_content' ); ?> <div class="post-content"> <div class="entry-content" <?php do_action('bp_article_post_content'); ?>> <?php the_content( __('...more »','mesocolumn') ); ?> </div> <?php wp_link_pages('before=<div id="page-links">&after=</div>'); ?> </div> <?php do_action( 'bp_after_page_content' ); ?> </article> <!-- POST END --> <?php do_action( 'bp_after_blog_post' ); ?> <?php endwhile; ?> <?php if ( comments_open() ) { comments_template(); } ?> <?php else : ?> <?php get_template_part( 'lib/templates/result' ); ?> <?php endif; ?> <?php do_action( 'bp_after_blog_entry' ); ?> </div> </div> <!-- POST ENTRY END --> <?php do_action( 'bp_after_blog_home' ); ?> </div><!-- CONTENT INNER END --> </div><!-- CONTENT END --> <?php do_action( 'bp_after_content' ); ?> <?php get_sidebar(); ?> <?php get_footer(); ?>
Is that correct?
At the moment I have both shortcodes on this one page. Perhaps I should go with just the shortcodes method and delete the page mentioned above? The libre one doesn’t show on the page, but the [rencontre] one shows on the page as normal text.
I went to the dog assisted dating page itself, and cannot see the dog-assisted-dating-page.php to select as a template, but did find a ‘full width’ template which I selected and published.
I also went to admin > rencontre > general > page where plugin is settled and ensured that the dog assisted dating page was chosen.
After all this, the only thing which shows on the dog assisted dating page is [rencontre] – Is this correct?
How do I add a test member to test everything displays? Or is there still something I need to do to get this set up correctly?
Thanks again for your patience, it is appreciated!
Thanks
Sally
Shortcode or Template. Not both.
Add this at the top of your page, after php tag :
/** Template Name: dog-assisted-dating-page */
Add a member as it’s written in Installation, para Quinto/.
RegardsHi Jacques
I managed that, I got the template showing and selected it. All seemed ok, then I moved on to tertio step and tried to edit my header.php to include that code needed and now my whole sites just stopped working. I’ve deleted the code I added to the header, still the same, only thing which brings the site back momentarily is deleting my browsing history, but it soon goes back to not showing, so now I’m just going to have to go and ask my host what’s going on.
I don’t think I’m going to get very far with this plugin, it just seems overly complicated to get it up and running. Most plugins you download and install and that’s pretty much it. I’m not a coder and I can’t afford to hire someone to do all this for me. I’ve tried for 2 full days now to get this working and its so frustrating because I really do want it to work, but I just can’t keep spending the rest of the week on just getting the page to show.
I’m sure it’s a great plugin when it’s up and running, I wish it could work for me.
Please could you let me know if you ever change it so I can install and just use it without having to mess with coding.
Thanks again for all your help
Sally
Ok, before I try this again, I just wanted to ask, as it’s just occured to me, is this the same registration page as would be found at the house of dog .co.uk/register/ ?
If so, won’t this interfere with my current free membership system set up there? I have buddypress on the site too.
Does this mean all new users signing up to the site will have to sign up as a dating member? Or will this all be completely separate? Obviously I don’t want to intergrate the 2 at all, as not all members will want to register for a dating site.
Thanks
Sally
Hi Sally,
I haven’t seen the links were already on the page. Cool !
So it’s very very very simple. Just add the two shortcodes in the page content.
Rencontre use WordPress register system. One is enough.
Regards
- The topic ‘Struggling with installation’ is closed to new replies.