• So I have a website and I like it. I have a css stylesheet that I like as well, but I can’t for the life of me figure out how to just place my new word press blog onto one of my pages and make it look just like everything else. I have quite a bit of html and css experience and very little php experience. I’ve visited the sites which try and explain how to seamlessly integrate both things, but it all seems like gibberish to me. Would anyone be willing to help me with my specific situation?

    What I do understand is that index.php references each of the other parts of the page which are stored in different documents (much like frames). My page is structured in divs, is there any possible way I can just paste the reference code inside the divs, so that my structure is kept? or am I going to have to figure out how to somehow recreate my current layout exactly into php form?

    Thanks!

Viewing 15 replies - 1 through 15 (of 18 total)
  • Thread Starter ksks

    (@ksks)

    Alright cool. So if I take an existing HTML page with my divs, add that code to the top and paste those codes inside the divs, and rename the file index.php everything will be good?

    Do you want to pull content from WP into your main site? Or do you want to make WP look like your site? If it’s the former, use the info in the link above. If it’s the latter, you’ll need to build a custom theme or customise an existing theme.

    https://codex.www.ads-software.com/Theme_Development

    Thread Starter ksks

    (@ksks)

    I went to both of those websites before I posed this thread. If I knew which of these would work with what I want, or even how to begin trying them, I would’ve tried them already.

    Can anyone try to address my questions directly instead of just directing me to other tutorials? I explained my entire situation already hoping someone could tell me what I need to do. I obviously have no idea what I’m doing, so a little bit of patience would be awesome.

    It comes down to which of the two options you want to use. If you just want to pull a few posts onto your main site and, effectively, not provide public access to the blog itself, I’d suggest going for Option A: integrating WP into your site.

    If you want a complete blog available for public display via your main site, go for Option B – creating/customising a theme that matches your site.

    Thread Starter ksks

    (@ksks)

    Well I want the posts to show up in the body of my website, I want to give the visitors the ability to make comments on the posts, and I want my sidebar to the right so that they can navigate to older posts. I don’t need a header or a footer. Should I use option A?

    I think, once you start getting into commenting, it might be easier in the long run if you use Option B.

    Thread Starter ksks

    (@ksks)

    Alright, so how would I begin transforming this skeleton layout into a theme? It’s in html format, not php. This tutorial just assumes your file is in php format.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml">
    <head>
    <link rel="Shortcut Icon" href="favicon.ico">
    <link rel="icon" href="/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    
    <title>
    kicksnarekicksnare.com - a melting pot.
    </title>
    </head>
    <body>
    
    <div id="wrapper">
    <div id="header"><a href="index.html"><img src="ksksbannerwhite.png" border="0"></a></div>
    <div id="links"><center>
    <a href="index.htm">music</a> //
    <a href="index.htm">film</a> //
    <a href="index.htm">art</a> //
    <a href="index.htm">photography</a> //
    <span class="current">blog</span> //
    <a href="index.htm">about</a>
    </center></div>
    <div id="maincontent">
    
    Here's where the posts would go.
    
    </div></div>
    </body>
    </html>

    Start by breaking down the HTML template into at least 4 distinct files:

    header.php – everything from <!DOCTYPE to <div id="header"><a href="index.html"><img src="ksksbannerwhite.png" border="0"></a></div>

    sidebar.php – everything from <div id="links"> to </center></div>

    index.php – <div id="maincontent"> to the first </div>

    footer.php – all the rest.

    Then read up on The Loop and wp_list_categories. You’ll need to former to display your posts and the latter to generate your (currently hardcoded) nav links.

    Also research what you must include in header.php and footer.php.

    I did the basic version which makes comments have to go to the blog site. Is there any way to keep this all in my site without having to link out to the wordpress site?

    Thread Starter ksks

    (@ksks)

    awesome. thank you so much esmi. except my images aren’t showing up. Even after I made an “images” folder in my theme and referenced them.

    Don’t use relative urls unless it’s within CSS files. WP doesn’t handle relative urls very well.

    Thread Starter ksks

    (@ksks)

    alright cool, well you knew I’d be back with a question. I want my nav links above the maincontent like they are, but I also want an actual sidebar with the archive and list of categrories and whatnot to the right. My sidebar.php file is already used with the nav links. What do I do??

    You can have as many sidebars as you want. If you call them names like sidebar-left.php or sidebar-two.php, you can use <?php get_sidebar('left');?> and/or <?php get_sidebar('two');?>.

    Thread Starter ksks

    (@ksks)

    awesome awesome awesome. alright. I think this may be the last question I have. For my sidebar-two.php, I just copied and pasted the contents of the “default” theme’s sidebar.php. I was able to reclassify the headings (Archive, Categories..etc) so that I could manipulate the font, size etc with css. BUT I cant find the code where “Blogroll” is, so I cant manipulate it…I don’t even understand how it even knows its there.

    here’s the site: https://www.kicksnarekicksnare.com/blog

    <div id="sidebar">
    
    <ul>
    			<?php 	/* Widgetized sidebar, if you have the plugin installed. */
    					if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
    
    <li>
    				<?php get_search_form(); ?>
    			</li>
    			<!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.
    
    <li><h2>Author</h2>
    			<p>A little something about you, the author. Nothing lengthy, just an overview.</p>
    			</li>
    			-->
    
    			<?php if ( is_404() || is_category() || is_day() || is_month() ||
    						is_year() || is_search() || is_paged() ) {
    			?>
    <li>
    			<?php /* If this is a 404 page */ if (is_404()) { ?>
    			<?php /* If this is a category archive */ } elseif (is_category()) { ?>
    			<p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>
    
    			<?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
    			<p>You are currently browsing the <a>/"><?php echo bloginfo('name'); ?></a> blog archives
    			for the day <?php the_time('l, F jS, Y'); ?>.</p>
    
    			<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    			<p>You are currently browsing the <a>/"><?php echo bloginfo('name'); ?></a> blog archives
    			for <?php the_time('F, Y'); ?>.</p>
    
    			<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    			<p>You are currently browsing the <a>/"><?php echo bloginfo('name'); ?></a> blog archives
    			for the year <?php the_time('Y'); ?>.</p>
    
    			<?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
    			<p>You have searched the <a>/"><?php echo bloginfo('name'); ?></a> blog archives
    			for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>
    
    			<?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    			<p>You are currently browsing the <a>/"><?php echo bloginfo('name'); ?></a> blog archives.</p>
    
    			<?php } ?>
    
    </li>
    		<?php }?>
    		</ul>
    		<ul role="navigation">
    
    <li><h3>Archives</h3>
    <ul>
    				<?php wp_get_archives('type=monthly'); ?>
    				</ul>
    </li>
    			<?php wp_list_categories('show_count=1&title_li=<h3>Categories</h3>'); ?>
    
    <ul>
    			<?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
    				<?php wp_list_bookmarks(); ?>
    
    <li><h3>Meta</h3>
    <ul>
    					<?php wp_register(); ?>
    
    <li><?php wp_loginout(); ?></li>
    <li><a href="https://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
    <li><a href="https://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
    <li><a href="https://www.ads-software.com/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
    					<?php wp_meta(); ?>
    				</ul>
    </li>
    			<?php } ?>
    
    			<?php endif; ?>
    		</ul>
    	</div>
Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Help integrating website with blog’ is closed to new replies.