creating wordpress template - wordpress

I need to create a fresh wordpress template using adobe dreamweaver . I want the template with image slider , stylish menus and commenting options. please guide me from basic to end.

Maybe you'll find this tutorial helpful:
http://www.adobe.com/devnet/dreamweaver/articles/dw-wordpress-multiscreentheme.html
as well as this:
http://www.adobe.com/devnet/dreamweaver/articles/dw_wordpress_pt1.html

Wordpress Template starts with
<?php /* Template Name: Stylish Template */ ?>
<?php get_header(); ?> // go to header.php add required js file for slider & menu through wordpress function() <?php wp_nav_menu($args); //check wordpress documentation for $args.
<div id="slider">
--images will go here
</div>
<div id="content">--Content Goes here---These will be posts from any category or latest posts, look wordpress documentation for <?php comment_template() to add comments if they are disabled.?></div>

Related

Include Advanced Custom Fields (ACF) in Wordpress the_content()

I've inherited a project structure that uses front-page.php to render the home page. Most of the site uses the Wordpress content field, but we've switched to building new features with Advanced Custom Fields. the_content() is used throughout the codebase to render content, and I'm wondering if there is a way to include ACF layouts in the_content().
An example workaround I've had to use for the homepage is below, if I don't call the layout in this way content won't render on the page. I'm new to ACF, so if what I'm describing is a fundamental misunderstanding of how to bring ACF into an ecosystem I'd appreciate any guidance on better file structures and calling content.
<?php get_header(); ?>
<?php
if (is_page('Home')) {
?>
<div class="container">
<div class="row">
<?php
get_template_part('/layouts/home');
?>
</div>
</div>
<?php
} else {
the_content();
}
?>
<?php get_footer(); ?>
You can use ACF in addition to the original "the_content()" or "get_the_content()" functions. That content comes from the default block or WYSIWYG editor. ACF comes from additional fields that you add to your pages or posts.
<?php get_header(); ?>
<?php
if (is_page('Home')) {
$home_acf_field = get_field('field_name_from_home_acf');//this assumes that the ACF field has been added to the home page, because I'm not using the second parameter
?>
<div class="container">
<div class="row">
<?php
get_template_part('/layouts/home');
echo $home_acf_field;//this could also be placed in "layouts/home"
?>
</div>
</div>
<?php
} else {
$acf_field_from_page = get_field('field_name_from_page_acf');
the_content();
echo '<div>'.$acf_field_from_page.'</div>';//an example of where this can go
}
?>
<?php get_footer(); ?>
You can incorporate ACF in the template part, or in the page itself. You need to have the ACF field set up in the CMS to be on home or wherever, but then it's as simple as what I showed you to pull it in (my examples were assuming text fields).
You aren't asking this question, but if you are using "front-page.php" as your home page, then why do you need the if statements to show content? You can use "the_content()" in addition to your ACF fields, especially if it's the content editor from the home page. Or, you can just hide it (it's an ACF setting).
Note: I wrote this from memory, and didn't test anything, so please excuse any potential typo. :)

How can I call a plugin in wordpress?

I'm trying to create my first theme on wordpress by zero.
I add Disqus plugin to manage the comments for the post.
which is the standard function to call the plugin in post page?
my current post page looks like this:
<?php
get_header('post');
//get_template_part( 'single-post-content' );
?>
<div id="slide1">
<div class="article_content">
<h2 style="margin-bottom: 50px;"><?php the_title(); ?></h2>
<div class="content">
<?php the_post(); the_content(); ?>
</div>
</div>
</div>
<?php get_template_part('post_footer'); ?>
I'd like to display the comments box under each post
how would you do it starting by zero?
You don't need to call the plugin's function.
To display the comments, you should call the comments_template function in your template and add a comments.php in your theme folder.
In the comments.php, you should call comment_form to display the default WordPress form.
And after you activate the Disqus plugin, the plugin will replace the default WP comment form by some actions and filters.
You can refer to the default WordPress theme to know how to display the comments.
The code is in twentysixteen/single.php and twentysixteen/comments.php
update
If the plugin(Disqus WordPress) doesn't work well, you could manually install Discuz on your theme. Please refer to https://help.disqus.com/customer/en/portal/articles/1183281-manually-install-disqus-on-wordpress

add theme to custom menu page in wordpress

I am writing a wordpress plugin. I am new to this. Now I have created a menu page in wordpress. It shows a list of items retrieved from database. But they are just raw text in a blank page. How could I make it consistent with the rest of wordpress?
Include get_header(); and get_footer();, like this
<?php
get_header();
/**
* write your code here
*/
?>
<p> Go Padres </p>
<?php
get_footer();
Thanks for all. Finally, I found what I need is WP_List_Table. I created a wordpress admin table using WP_List_Table.

Buddypress Plugin Theme error

This is with respect to a buddypress addon (plugin) whose theming I am unable to do. I searched many sites but unable to get a concrete solution. In the plugins page, Header is getting disturbed if its a buddypress theme but is working fine in default wordprress themes.
I am using this code at present at the top of the template page
<?php get_header('buddypress'); ?>
<div id="buddypress">
<div id="profile">
<div class="row">
Than the following stuff like
<?php do_action( 'bp_before_member_home_content' ); ?>
<div id="item-header" role="complementary">
<?php bp_get_template_part ( 'members/single/member-header' ) ?>
</div><!--#item-header-->
I feel this is not the right way to do. I want to know if the plugin has to copy the buddypress template header without disturbing footer or sidebar how it can be done. i.e my plugin should show only the plugin content and should not disturb any part of the buddypress template.
you have to edit your buddy press header with your html structure.
and keep buddy-press functionality as it is.

How to have a folder structure in a wordpress template (For ex : http://www.example.com/products/story)

I am new to wordpress and trying to get my head around it. I figured that I can create a custom php file as
<?php
/*
Template Name: The Story
*/
?>
<?php get_header() ?>
<?php get_sidebar(); ?>
<div class="story_content"><?php echo get_option('story-content') ?></div>
<?php get_footer() ?>
and in the admin panel , I can add a new page and choose "the story" as the template , which will in turn , give me an URL as http://www.example.com/thestory
But for the life of me , I can't figure out how to have a directory structure in the website such as http://www.example.com/products/thestory
Can someone help me out here.
Thanks already!
You can achieve this with "Pretty Permalinks" enabled in WordPress, by simply creating two pages:
A Products page with a slug of /products
A The Story page that is a child of Products (i.e. The Story has a parent post: Products). You'd make this slug /thestory (it will automatically be appended to the parent slug: /products)
This can all be done from within the Dashboard Pages area, without editing templates.

Resources