• Hello, how can I please remove my text box, so that my front page only shows the background image. I’d then like to write directly onto the background image. My front page is static and fixed, without a running blog.

    Thanks!

Viewing 14 replies - 1 through 14 (of 14 total)
  • If you can provide a link to your site it would be helpful.

    Thread Starter alexbenjamin

    (@alexbenjamin)

    Oh thanks – here it is: http://schmoozemedia.net/

    Remove the elements in the <body> tag on your custom home page, leaving the body as:

    <body>/*<====remove content between the body tag===>*/</body>

    @swansonphotos:

    Since it’s an actual WordPress page, you can’t really do that…

    Unless you’re suggesting altering single.php or using a custom page template.

    @alexbenjamin:

    What exactly are your looking to get rid of? Everything except the text or absolutely everything? I would assume since you want to “write directly onto the background image,” you still want the text to be visible?

    Also, will this be the only page on the site? If there will be other pages do you want this to apply to every page or just the front page?

    If you’re looking to get rid of everything but the text on your home page something like this added to your theme’s style.css would do it:

    .home div.clearstyle_c1_alt,
    .home div.clearstyle_c2,
    .home table.clearstyle-title {
        background: none;
    }
    
    .home #content table,
    .home #content tr td,
    .home table.clearstyle-title {
        border: none;
    }

    If you want to hide everything but the background image you can use this instead:

    .home #main {
        display: none;
    }

    Using a child theme to edit a theme’s code is always a good idea:

    Child Themes

    As mentioned earlier you could also create a custom page template that shows whatever you want, then set your static front page to use it:

    http://codex.wordpress.org/Pages#Page_Templates

    If you create a template named front-page.php it will be used automatically for your site’s front page.

    I’d then like to write directly onto the background image. My front page is static and fixed, without a running blog.

    Hiding with CSS does not stop the dynamic creation of content, it just tells the browser to not display it, which means the server has to create it for the browser then to hide it…I would make this a last choice.

    Thread Starter alexbenjamin

    (@alexbenjamin)

    Thanks so much for the replies. I’d like to have a single page for the time being, with a background image and text appearing directly on it. I guess something like a placeholder page, while i’m figuring out what i’m doing.

    I tried the code and couldn’t make it work, but that’s probably just me being new to this.

    Thanks again, really appreciate the suggestions.

    @swansonphotos:

    My first CSS example doesn’t really hide anything, it just overrides the backgrounds and borders around the text. As for hiding everything in my second example, yes the content is still being created. However, WordPress runs all its queries before reaching the specific template, so even if you removed the loop, the actual processing time and resources needed to create the page would be about the same.

    Again, you can’t simply “Remove the elements in the <body> tag” because the page doesn’t actually exist in that form. You can alter the theme or create a custom page template though, which is what I mentioned at the bottom of my previous post. 🙂

    @alexbenjamin:

    Would the text be a part of the image or the actual WordPress page content? It looks like you switched over to HTML pages for now. If you want to try again with WordPress, I’ll be happy to look around for what went wrong.

    If this is only a temporary placeholder page, you could also consider one of these plugins:

    http://wordpress.org/extend/plugins/custom-coming-soon-page/
    http://wordpress.org/extend/plugins/wp-maintenance-mode/

    I was fairly sure the body could contain what you want, including just static html which would work great with a cache plugin or server that supports caching to make home page visits zippy…A background image, some text and a link to enter site which would be a page using a different template…do templates in WordPress HAVE to call php functions, make queries?

    @swansonphotos:

    WordPress itself runs through all the normal queries before hitting the proper template file. It’s how it knows which file to use. Unless your adding additional queries or doing something out of the ordinary, the actual code within templates is relatively light. Yes, you can create and use a custom template or alter the proper part of the theme…but that’s not exactly what you suggested. 🙂

    No, template files don’t need to use any PHP. It is good form to include the theme’s header and footer though.

    Most page caching plugins will already serve cached static HTML pages regardless of how the original page was created. So, except for saving a tiny bit of processing time when the cache is re-built, it doesn’t really matter how static the original uncached page is.

    If this is going to be a permanent (rather than temporary) landing page, the OP could always use a normal HTML file and install WordPress in a subdirectory. Considering that this page doesn’t require any WordPress related functionality and is considerably different from the theme being used this is probably the best thing to do.

    WordPress itself runs through all the normal queries before hitting the proper template file.

    Yet we can control what is in these files? For example, can I not remove a function my theme adds but I do not use?

    Can we not limit queries in this fashion?

    @swansonphotos:

    The code for the main query is within the core WordPress code. The best way to alter it before it executes is by hooking into an early enough action. By the time WordPress hits the actual theme template for the page being shown it has already run the necessary query to pull whatever post(s)/page content it needs. If you try to alter it within a template file, it will simply run a completely new query.

    Removing/editing a function that is declared within a theme isn’t quite the same.

    Is there a method of testing how many queries are made? How such modification reduce them? Can you elaborate?

    For the first link provided:
    “This article is a (hopefully complete) list of the action hooks available for use in plugin development in Version 2.1 and above of WordPress. For more information: “

    I am fairly sure the average WordPress user is not going to try to mess with core WP…

    You’re second link is also only related to a template file calling query_posts()

    Do your theme(s) use this?

    @swansonphotos:

    To check how many queries your site is currently running, you can use this:

    Function Reference/get num queries

    The easiest way to see every query being run on your site would be this plugin:

    http://wordpress.org/extend/plugins/debug-queries/

    You don’t have to mess with core code to use hooks and filters. In fact, that’s specifically why they exist. You use them in a plugin or your theme’s functions.php. Altering the main query isn’t something an average user would do at all.

    query_posts() is the standard function to alter the main loop. I was specifically pointing you to this bit of information which is general to WordPress:

    …WordPress will have already executed the database query and retrieved the records by the time it gets to your template page (that’s how it knew which template page to serve up!).

    …such as modifying the default request directly (before it’s called). The request filter can be used to achieve exactly this.

    Do your theme(s) use this?

    I’ve built themes and plugins with several opportunities to use query_posts() and filters to alter the main query. 🙂

    Since these posts don’t have much of anything to do with the OP’s original topic it would be best to continue asking questions in a new topic or, if you want to direct them specifically towards me, on my site.

    Thread Starter alexbenjamin

    (@alexbenjamin)

    Thanks very much for helping me with this! As an interim measure, I’ve opted for another program – only because I was getting really out of my depth. I still intend using WP for this site and others. I just need to figure it out more – and this feedback has really helped with that.

    Thanks again!!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘How can I remove the textbox/form from my page?’ is closed to new replies.