I'm very confused here. I am very familiar with Wordpress, however, I cannot get the home page of my site to display the HTML and PHP etc that is currently in my home page template.
I have gone to settings - reading and set the home page to a static home page under 'Home', which as you can imagine has the page template for the HTML/PHP I want to display.
I was wondering if anyone knew of any other external factors that affect the home page and the templates being brought through on my other pages are actually working - it's very odd.
I have checked the DOM on the browser multiple times, using Chrome, however none of the divs etc are showing.
Here is the code for the front page so far:
<?php
/* Template Name: Home Page Template */
?>
<?php get_header(); ?>
<div class="header_banner">
<div class="image_content">
<div class="image">
<video playsinline="" autoplay="" muted="" loop="" poster="" onplaying="this.controls=false">
<source src="<?php echo get_stylesheet_directory_uri(); ?>/videos/video_background.mp4">
Your browser does not support the video element.
</video>
</div>
</div>
<div class="main_content center center_absolute">
<h1>I create and design websites.</h1>
<h2>I specialise in HTML, CSS, jQuery and Wordpress.</h2>
</div>
<div class="center_scroll">
<div class="scroll">
<i class="fa fa-chevron-down" aria-hidden="true"></i>
</div>
</div>
</div>
<?php get_footer();
One possibility is that the page you selected in the dropdown menu under Settings > reading does not have "Home Page Template" template selected under "Page Attributes" Meta Box.
You could rename the file to page-home.php since this template will only be used once on your site. Maybe this helps.
Related
Ok guys.
This is the first time I've posted here on stackoverflow.
I think it's not such an impossible thing.
My client would like this page here, which I did in html5 and php via wordpress, to become interactive through the custom fields.
what the client want
I searched for many guides for a day, but I found nothing.
I would therefore need a code where the customer through the wordpress management system can load the custom fields and the gray blocks with the custom fields appear on the screen.
I tried this code, but to no avail:
<div class="col-lg-3 col-md-4 col-sm-6">
<div class="bg_light_grey block_informazioni mx-auto info mb-5">
<div class="block_informazioni_child">
<i class="far fa-dot-circle dark_blue"></i>
<h3 class="semibold dark_blue mt-2">
<?php echo "".get_name($post->ID,'',true); ?>
</h3>
<h4 class="regular dark_blue">
<?php echo "".get_post_meta($post->ID,'',true); ?>
</h4>
</div>
</div>
</div>
I installed a plugin for a dropdown menu (Max Mega Menus) but my wordpress theme (Spacing) is overriding it. I followed the instructions on the MMM website on removing residual styling so that the plugin would work but when I deleted the codes as instructed (I think I picked the right one) then the menu disappeared altogether. Here are the instructions I was following: https://www.maxmegamenu.com/documentation/faqs/removing-residual-styling/
Here is the current coding. I tried deleting every combination of things besides the wp_nav_menu part, as instructed.
<div id="header">
<div id="wrapper">
<div class="container clearfix">
<div id="navigation">
<?php wp_nav_menu(array('menu' => 'custom_menu')); ?>
<?php if($of_option['st_responsive']) responsive_select_nav() ?>
</div>
</div>
</div>
Please go to Mega Menu > General Settings > Menu Locations. You'll see a list of menu locations that your theme has registered. Expand the one for the top menu and copy the PHP include code. Then replace the call to wp_nav_menu in your header.php file with it.
In short, your wp_nav_menu call is missing the required 'theme_location' argument.
i create block with views module for Print Promoted to front page, this worked and i see result in my front page. this views worked with field and i print title, thumbs, content. now i need to custom this theme views for show in jquery content slider.
i click in advanced->theme->information i see this:
field content revision: views-view-field.tpl.php, views-view-field--title.tpl.php, views-view-field--frontpage.tpl.php, views-view-field--frontpage--title.tpl.php, views-view-field--block.tpl.php, views-view-field--block--title.tpl.php, views-view-field--frontpage--block.tpl.php, views-view-field--frontpage--block--title.tpl.php, views-view-field--block-1.tpl.php, views-view-field--block-1--title.tpl.php, views-view-field--frontpage--block-1.tpl.php, views-view-field--frontpage--block-1--title.tpl.php
But i don't find any .tpl.php theme files for edit theme design using html and css. how to create custom design theme for print my result with this format:
<div id="content">
<ul>
<li>
<div class="title">title1</div>
<div class="thumbs"><img 1 ......></div>
<div class="content">content1</div>
</li>
<li>
<div class="title">title2</div>
<div class="thumbs"><img 2 ......></div>
<div class="content">content2</div>
</li>
</ul>
</div>
I think the Views 2 theming guide has already explained everything clearly. Just follow the steps there and it only takes just minutes.
I have started to learn how to make custom themes for wordpress and have problems when installing plugins that have shortcodes. I try to add a shortcode ( usually a form plugin, i have tried two different ones and also an ecwid shopping cart yet no shortcodes have worked, yes the plugins were activated) by creating a page and using the visual/html editor. When i check the page it does not show anything. here is my single.php..
<?php get_header(); ?>
<body>
<div id="maintopwrapper">
<div class="container" id="topwrapper">
<div class="row">
<div class="span8">
<?php while (have_posts()) : the_post(); ?>
<!-- Content Here -->
<div class="row"><div class="span8 greygrad round">
<div class="padding"><div class="content" style="margin-top:25px;"><?php the_content(); ?></div></div></div></div>
<div class="row margintop"><div class="span8 greygrad round">
<div class="padding">
<?php comments_template() ?>
</div></div></div>
<?php endwhile;?>
</div>
<?php get_sidebar(); ?>
</div>
</div>
</div> <!-- end of maintop wrapper-->
<?php get_footer(); ?>
It should show since the_content() is there right? Let me know if you need anything else for me to share. Plugins I tried a gravityforms, ecwid shopping cart, and quforms..all of which the shortcodes do not work. The only way I got one of them to work is by creating a custom page theme and adding hardcoded php to call the function but I rather have shortcodes working so the theme is usuable by people who dont code.
For live example: http://modernlogic.co/wp
the "contact" page in menu is actually hardcoded in the custom theme which is not using the shortcodes like I want in the "sample page" in menu
Thanks in advance
I am a idiot... I realized that I had no page.php and so when I tried adding the shortcode to a page it referred to the index.php instead of page.php(since there was none) and so it only showed the excerpt and not the content. I figured this out because I tried adding the shortcode to a post and so when it went to single.php, the shortcode worked since it has content and not just excerpt. oh well I guess trial and error.. Thanks for trying to help me anyway
I'm working on this website in WordPress and I want the content with the title "Featured Business" that's on the sidebar to appear on all pages. I created a template for it but it doesn't display when called. The code is as shown below.
<div id="ftb">
The content
</div>
<!-- End FTP -->
and I called it with <?php get_ftb(); ?> But it doesn't show.
If you want to display a chunk of html that's part of the sidebar (but not the entire sidebar), I recommend to place it on functions.php, like this:
<?php
function get_ftb() {
?>
<div id="ftb">
The content
</div>
<!-- End FTP -->
<?php } ?>
After that you'll be free to call it with get_ftb();
If you just need to call the entire sidebar, use get_sidebar() instead.