How Create Responsive One Page WordPress Theme with scrollable effects? - wordpress

Where can I find a soucre that learn to create a Responsive One Page WordPress Theme so when I click on the menu item it scroll down.
Here is an example of what I want http://thememints.com/templates/?theme=Cingle%20WP.

I have had exactly the same question and after searching around found this post.
I was rather shocked to see the responses to this question. It seem to me like people are quick to answer questions without properly reading the question.
All the contributors have given solutions to responsive and parallax scrolling websites but not one has answered the real question.
It is not too broad, and it is not vague. All he is asking is how you go about creating a Single page theme in WORDPRESS.... no one gave any direction as to how to accomplish this.
Not sure why these answers got rated as usefull .
So after digging around with trial and error I found the following to answer the question as to how you go about to create a single page WORDPRESS theme.
One of the major aspect to understand is the Wordpress query-post function which allows you to post multiple page content such as home , about, service and content onto a single page.
To create the the menu structure to scroll to the different sections I found this tutorial to be usefull - create-a-single-page-wordpress-website
I hope this helps

As William Patton said this is a broad question but as far I can understand this may help :
http://www.designerledger.com/parallax-scrolling-tutorials/ for the one page theme.
and a basic start for wordpress development theme :
http://codex.wordpress.org/Theme_Development
Update : I found this awesome plugin that helps you create full screen pages
https://github.com/alvarotrigo/fullPage.js
EDIT 2016
Due to the many up votes at user3263807 answer I made a small/basic one page guide for wordpress. For css/js there are plenty good tutorials and plugins over the internet. Also I assume you are familiar with WordPress Themes.
First of all you should create a template file for your one page. Let's call it template-one-page.php. The template name, commented inside the file, is the name that will appear in Page Attributes -> Template when you creating a page inside admin panel. After that create a page, ie Home, and assign as template your template. If you want your page to appear as front page (when you enter mydomain.com this page will be shown) go to Setting->Reading->Front page displays->A static page and set as front page your page.
// File Security Check
defined('ABSPATH') OR exit;
/*
Template Name: One Page
*/
?>
Normally a one page has sections. So we want to decide what type of sections we want. It could be pages, child pages, posts, custom fields (like a repeater from ACF) etc.
<?php
$id = get_the_ID(); // The page id
$sections = get_posts(array('post_type' => 'page', 'post_parent' => $id)); // get all child pages
foreach ($sections as $key => $section):
?>
<section id="page-<?php $section->ID; ?>" <?php post_class('', $section->ID); ?>>
<h1><?php echo get_the_title($section->ID); ?></h1>
</section>
<?php endforeach; ?>
Or with a Loop
<?php
$id = get_the_ID(); // The page id
$query = new WP_Query( array('post_type' => 'page', 'post_parent' => $id) ); // get all child pages
if($query->have_posts()):
while ( $query->have_posts() ) : $query->the_post();
?>
<section id="page-<?php the_ID() ?>" <?php post_class(); ?>>
<h1><?php the_title(); ?></h1>
</section>
<?php endwhile; wp_reset_postdata(); ?>
<?php endif; ?>
You can query what ever you want depending the need of your site.

you should take look at below link:
[1] http://www.1stwebdesigner.com/css/responsive-website-tutorial/
[2] http://www.1stwebdesigner.com/css/create-a-responsive-website-video-tutorial/
[3] http://readwrite.com/2013/04/16/10-developer-tips-to-build-a-responsive-website-infographic#awesm=~okrhufNGLHp1mh (Best one to keep points in mind while creating )
Thanks.

Here is full detailed video tutorial that deals with setting a one-page scrolling Wordpress website from any theme you want. Need to join - there is a free trial. This allows you to "peek under the hood" and understand the principle of how the other one page themes and plugins were created.
http://www.lynda.com/WordPress-tutorials/WordPress-Building-One-Page-Style-Site/169876-2.html
I have looked into several ready-made themes, such as Onesie and OneEngine, and found them a nightmare to manage on the back end, very user unfriendly. The content of the long home page with several sections in both themes is managed not through the Pages section, like one would assume, but through a different admin section in the Appearance folder, with none of the usual Wordpress interface controls. The tutorial above deals with it properly, with the real Wordpress Pages assembled by a custom loop on the front page and menus working in the same way as built-in Wordpress menus.

I used localscroll and scrollTo jquery plugin in my one page theme, it's working fine.
The plugins link:http://flesler.blogspot.com
After you imported the jquery and plugins files into your page, just call the function like below, then if you click a anchor link, the page will scroll up or down smoothly.
$.localScroll({
target:'body',
duration:1000,
queue:true,
hash:true,
easing:'easeInOutExpo',
offset: {left: 0, top: -55}
});

Related

Advice on page/slug architecture

I am looking for some sage advice on how to best create a page/slug structure for a WP site I am building. It is a portfolio site that will showcase creative work. I have currently created several custom post types for things such as the portfolio/work items and for their associated clients and have created relationships between those items using the Advanced Custom Fields Plugin. All of this works great. What I am struggling with is how to create the best URL structure.
I have the following pages already created and working well:
/work/ - index page that shows all work regardless of client
/clients/ - list of all clients
I need to create the following pages:
/clients/client/ - this page would show all work associated with a specific client. Here is where I am struggling. I need help understanding how to use the page template system to set the correct page slugs. Can I use page slugs as part of my WP query? Can I simply query based on the custom post type? What do I name the page template file for this to work?
Appreciate any advice and/or examples anyone can offer. Thank you.
WordPress offers an easy mechanism to handle pages and posts as well that are being created and rendered. It is us who has to take up the challenge to do those wonderful designs and tasks that we need. Moving on to the following topic of page and slug architecture we shall discuss in detail.
First let us look onto the following thing.
Creating Page Template for Custom Posts Type
Ex: If you are creating the post type called news the WordPress system will look for the following structures.
single-{post-type}.php
archive-{post-type}.php
single-{post_type}.php
If your custom post type were 'news', and/or query_var = "news", WordPress would look for single-news.php to display the single or permalink of the post.
archive-{post_type}.php
If your custom post type were 'news', and/or query_var = "news", WordPress would look for archive-news.php to display the archive of posts.
If these files are not available in your Theme's directory WordPress will look for archive.php and single.php, respectively. If even these files are not present it will default to index.php.
Template File will be like this.
<?php
$args = array( 'post_type' => 'news', 'posts_per_page' => 10,'post_status'=>'publish','orderby'=>'ID','order'=>'DESC' );
$the_query = new WP_Query( $args );
?>
<?php if ( $the_query->have_posts() ) : ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<h2><?php the_title(); ?></h2>
<div class="entry-content">
<?php the_content(); ?>
</div>
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
Hence from the above code you can display the Latest Posts from News category in the count of 10.
If you need the count to be infinite you have to change the post_per_page=10 to post_per_page=-1.
Hope so this reference and advice that i have tried to explain will be helpful for you. Still if you face any issues about my explanation comment over to my answer and i am there to help you.
I didn't go this exact route to resolve my question as I am using the Advanced Custom Relationships plug-in. My solution is somewhat similar to this: https://www.advancedcustomfields.com/resources/querying-relationship-fields/ - but your response was very helpful and got me going on the right track, thank you!

Add items to portfolio page via dashboard

In one theme (FloZo) I've seen a nice functionality and I would like to learn how to make something similar. It's about a portfolio page, take a look at the demo "Our Work section".
You create a page and give it a template (Work archive) via Pages menu - more or less understood
You don't add any pictures there!
In your Dashboard you have a nice "work" section, where you can choose "make a new work item" - you add pictures with titles and descriptions there. - This is the big trick!
Now: my newbie idea on how it works:
The template is just the "body" of the page with the title
The dashboard "work" section must be doing something like this:
When you post a work item, it pastes/appends the whole item code into your page (like an item template code) with your specific image and text. It also creates an item-specific page (it's where you end up after clicking on an item).
My question is: is there any slightest possibility to add such a functionality to a Wordpress theme?
Here is how I see it:
The page template, 'Work Archive' has the loop that is displaying posts of 'Work' post type.
So to achieve this first you have to add the custom post type of your liking, and then in the page template add a custom loop to display these:
<?php
$args = array(
'post_type' => 'your_post_type',
'posts_per_page' => -1 //or whatever you choose
);
$work_query = new WP_Query($args);
if ($work_query->have_posts()) : while ($work_query->have_posts()) : $work_query -> the_post(); ?>
<!-- loop content goes here -->
<?php
endwhile;
endif;
wp_reset_postdata(); // always reset post data after custom loops
?>
If you need more info pleae don't hesitate to ask.
Happy coding!

Basic Fishpig Wordpress Integration - Display Custom Post on Homepage

I'm trying to create a slider on the homepage of my Magento site. I am totally new to Magento and have someone else on our team coding most of that stuff after realizing how far into the deep end I jumped.
My issue: I'm trying to pull custom posts from WP (with the paid advanced custom fields extension) to display an image that will go into a slider.
I'm stuck at the most basic part - pulling in a list of Wordpress posts.
I created a new file: mytemplatedirectory/default/template/home/slider.phtml with
<?php $posts = $this->getPosts() ?>
<?php foreach ($posts as $_post) : ?>
<?php echo $post->getPostContent() ?>
<?php endforeach ?>
and I put this into the CMS page in the Magento admin:
{{block type="core/template" template="home/slider.phtml"}}
But not even the default post is showing up.
If anyone has any guidance that would be extremely helpful. The beginning steps are what are throwing me off but it would also be nice to have help pulling the custom post and the advanced custom field (although it seems that Fishpig's documentation makes this pretty simple).
Thanks in advance! Sorry for such an amateur question.
The block type you're using does not include the getPosts() method, which is the reason your call to this returns nothing. If you change the block type to 'wordpress/sidebar_widget_posts' then the call to getPosts will return a post collection object.
The following link explains a little bit more about how to include this block and what you can do with it:
Display WordPress Blog Posts on the Magento homepage
Figured this out with Ben's help (who I believe is the creator of the excellent Fishpig extension).
I created a custom post (with the Custom Post Type UI plugin for WP) and a custom field (with the Advanced Custom Fields plugin for WP).
On my Homepage in the CMS I added in the content area
{{block type="wordpress/sidebar_widget_posts" name="wordpress.widget.recent_posts" post_count="5" post_type="slider_home" template="wordpress/sidebar/widget/slider_home.phtml"}}
In that block, slider_home is my post type and slider_home.phtml is a new file I created that pulls the code from wordpress/sidebar/widget/posts.phtml but customizes it to my need.
Within the loop in slider_home.phtml I took out what was currently there and added:
<?php $image = $post->getMetaValue('image'); ?>
<?php $url = $post->getMetaValue('url'); ?>
<a href="<?php echo $url; ?>" target="_blank">
<img src="<?php echo $image; ?>" />
</a>
which is pulling in the custom fields I made in Wordpress. works perfectly and now my client will be able to update their Magento site through the Wordpress CMS.

Wordpress ignoring page template from drop down

I am struggling with something that appears to be easy, page templates. I have read plently posts on this, people seem to forget to put the comment at the top of the page and can't get it to show up in the drop down menu on pages. I can do this, my problem is the next stage.
I have written the most basic template (custom-page.php):
<?php
/*
Template Name: Test template
*/
?>
<?php get_header(); ?>
<h1>Teams!</h1>
<?php get_footer(); ?>
It shows up and I can select it on the new page sidebar. However when I visit that new page it seems to have defaulted the archive page using the content template include.
Thanks in advance.
If you put the following in your footer, you should be able to grok some further information about how your template is being selected (and know exactly what might be happening).
<?php global $template;
echo(basename($template)); ?>
Then look for the template name in your footer. It's possible (like #adomnom said) that you have a slug conflict. There are a handful of other strange scenarios that could be caused by plugins, custom functions, or other factors as well.
By the sounds of things, it could be conflicting with another template.
For example, if your page has the slug 'category' and is set to use the custom template 'custom-template.php', it would conflict with (and be overridden by) category.php, which is the default template for showing posts for a specific category.
I recommend changing the slug to see if that's the problem.

how to have wordpress comments functionality on every page

i am new to wordpress , i was given a task to convert a web site into wordpress. Following is what i have done.
i changed the header of twentyten theme and added lot of javascript lib which were included on the original page.
i changed the index.php page and added the tables and divs so that site can have look and feel what it had before.
After reading bit of codex. i added the following at the bottom of the page to show wordpress comments.
<?php
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-index.php and that will be used instead.
*/
get_template_part( 'loop', 'index' );
?>
</div><!-- #content -->
</div><!-- #container -->
Till here every thing works fine and wordpress is show comments on this page as well. Now in the menu there is another page called next_level.php so i thought to display the commenting functionality of wordpress at the bottom of that page as well. so what i did as follows.
i included the same get_header() in the next_level.php page so that header source remains the same.
i had few database queries running to display this page contents and for that i imported few tables from the previous site into the wordpress database. working fine.
The only problem i have is to show a commenting machenism of wordpress at the bottom of this page. Please guide,correct,suggest and help how to achieve this. Sorry for the long post.
Hey, I couldn't really understand the process you did or the result required, but I think this is the only line you need to display the comments at the bottom:
<?php comments_template( '', true ); ?>

Resources