0

The Problem

So I installed a plugin (iHomeFinder's Optima Express), and it works perfectly fine. The page it made is conradbowenrealestate.com/homes-for-sale-search. However, this page isn't made in WordPress, it doesn't even exist to it. I want to make it the homepage, but since WordPress doesn't recognize it as a WP page, I can't set it as the homepage. Note that when viewing the source code, the "page-id" is 0.

What I've Tried

I've tried using this code in the functions.php file, but it doesn't enact any change on the website:

$homepage = get_page('0');

if ( $homepage )
{
    update_option( 'page_on_front', $homepage->ID );
    update_option( 'show_on_front', 'page' );
}

It does work if I change the ID to one of the pages listed in my WP-Admin's "Pages" section. get_page_by_title doesn't work since again, that's for WP pages and this is invisible to WP.

I've also tried recreating the object on the plugin page by going to the source code and copy/pasting it to my homepage's code. While it does work and is functional, it is out of proportions (too much space between options).

My Question

How can I get this search plugin on my homepage? I want the above mentioned plugin page to be what shows when you go to conradbowenrealestate.com.

Edit:

I failed to mention that within the plugin settings, I am limited to: http://conradbowenrealestate.com/ [insert text here] /. If I leave it blank, it won't save.

  • I got a downvote already. Does this question not belong here or something? – Spencer4134 Jun 28 '17 at 23:25
  • 1
    Yeah someone should have commented why, but you have not specified what the plugin is you're using so there's really no way for us to help without that information – sMyles Jun 28 '17 at 23:32
  • K I added the plugin – Spencer4134 Jun 29 '17 at 0:01
  • have you tried to simply add a 301 redirect from your homepage to that specific page? – DigitalDesigner Jun 29 '17 at 0:36
  • It is hard to advise without reviewing what plugin is doing exactly. page-id-0 instantly smelled like hackish to me, that’s clearly invalid singular context and probably shouldn’t happen. – Rarst Jul 5 '17 at 9:42
0

There are a few methods to accommplish this goal.

Easiest in my humble opinion is to do a HTACCESS Redirect such as

 Redirect 301 / http://conradbowenrealestate.com/homes-for-sale-search/

Another method would be to use the wp_redirect function as shown in the codex add a new function and include a code snippet like the one below to your functions.php file.

 wp_safe_redirect( $url );
 wp_redirect( 'http://conradbowenrealestate.com/homes-for-sale-search/' );

The third option would be to use a plugin such as Redirection With this plugin you can address your 301 redirects right from within the WordPress dashboard.

Hope one of these solutions solve your issue. :)

  • Thanks! I'll test these the next time I'm in the office. – Spencer4134 Jun 29 '17 at 0:59
  • I am not too keen for using redirect for such. Literally it doesn't do what questions asks to do. – Rarst Jul 5 '17 at 9:39
  • So, I tried it, and first off, it doesn't do what I need. I need the url of the page to be conradbowenrealestate.com and the page content to be conradbowenrealestate.com/homes-for-sale-search. I tried your methods, and all it did was redirect to conradbowenrealestate.com/homes-for-sale-search/homes-for-sale-search... (repeating about 12 times). It said it wasn't rediriecting properly. Now I have a bit of work to do to undo this. – Spencer4134 Jul 6 '17 at 16:24
  • Nevermind I'm able to undo it, it's just cached in my browser. – Spencer4134 Jul 6 '17 at 16:31
  • I did some research. You really should tell people to test the redirect with a 302 before they do a 301. Luckily I doubt anyone else was affected, and I just cleared my cache. – Spencer4134 Jul 6 '17 at 16:35
0

I figured it out!

Solution

Go into the desired page's editor (In this case my static homepage) and click the "Visual" tab, and at the top there is a shortcode option for Optima Express that lets you put the search form on the page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.