i've been messing around with Gutenbergs new Site Editor tookit and building a block based theme. One thing I cannot for the life of me figure out though is how to set up a custom page global theme using the block editors .html template files. I can't seem to find any documentation either. For reference, this is the PHP code you add at the top if doing it "the old fashioned way:
<?php
/**
* Template Name: Full Width Page
*
* #package WordPress
* #subpackage Twenty_Fourteen
* #since Twenty Fourteen 1.0
*/
This signifies to wordpress that this is a page attribute theme that can be chosen. In contrast, here is what I have for a example in the new block editor:
<!-- wp:cover {"url":"http:\/\/wppld.local\/wp-content\/uploads\/2021\/03\/bigstock-Panoramic-View-From-Cannon-Mou-195735793.jpg","id":18,"align":"full"} -->
<div class="wp-block-cover alignfull has-background-dim">
<img
class="wp-block-cover__image-background wp-image-18"
alt=""
src="http://wppld.local/wp-content/uploads/2021/03/bigstock-Panoramic-View-From-Cannon-Mou-195735793.jpg"
data-object-fit="cover"
/>
<div class="wp-block-cover__inner-container">
<!-- wp:paragraph {"align":"center","placeholder":"Write title\u2026","fontSize":"large"} -->
<p class="has-text-align-center has-large-font-size"></p>
<!-- /wp:paragraph -->
</div>
</div>
<!-- /wp:cover -->
<!-- wp:post-title /-->
<!-- wp:post-content /-->
<!-- wp:template-part {"slug":"footer","align":"full"} /-->
I appreciate any help!
Gutenberg momentum is slow to take off. Gutenberg is the answer for WordPress to Shopify. They felt threatened by it and decided to switch to visual editing and push hard on their main income avenue, WordPress.com. The main focus is towards providing a service able to compete with Shopify.
There is (hidden) documentation, in regards to future plans WordPress has. With recent changes, for example, did you know that soon the main standard for WordPress development will be Block-Based Design ? Soon being in the next 3/5-ish years of course.
Full site editing is an experimental feature and the workflow in this tutorial is likely to change.
It is still really early in development. It's the evolution WordPress is currently going for. Where you could supply a set of blocks to use straight from the gecko, upon choosing a page template or for the landing page too.
But to be honest that's it. Even tho Gutenberg was introduced, it has not yet found it's placed.
Related
My developer has updated my Wordpress to the latest and with it comes Gutenberg. I'm not a fan and I see every one of my HTML paragraphs now looks like this:
<!-- wp:paragraph -->
<p>Hello world!</p>
<!-- /wp:paragraph -->
Needless to say, the <!-- wp:paragraph --> is confusing to me, especially because I write my content in HTML. It has the block tags around everything, including images. I don't want to deal with these.
I tried using this plugin to disable Gutenberg entirely: https://wordpress.org/plugins/classic-editor/ but the Gutenberg paragraph tags remain. How can I revert my HTML content back to how it was before this awful Gutenberg update?
I have a footer CTA widget (Best Quality Guarantee) that is appearing on all of the pages on my site, besides the shop and product archive pages.
How do I get it to appear on these pages as well?
The code for the widget is here -
<div>
<a class="best-quality-link" href="/best-quality-flowers"><img src="/wp-content/uploads/2018/07/Better.svg" alt="Best Quality Flowers" /></a>
<hr class="separator" />
</div>
You can see the Best Quality image on the bottom of this page - www.flowersforeveryone.co.za
But it doesn't appear on this page - https://flowersforeveryone.co.za/product-category/roses/
looking at your source code on the archive page it shows that better.svg is definiteley there but it looks like your lazy-loading isn't triggering and displaying it as it still has the 'lazy-hidden' class attached to it. Try disabling lazy load and see if it appears. If it does, then try play with your lazy load plugin settings and if that fails try use a different plugin.
I set up a Drupal page, which has two different content-types. One is "articles", one is "reviews".
In my theme folder, I set up two node templates for these content types. node.html.twig (standard template - articles), and node--reviews.html.twig.
When I add an article, node.html.twig is used, when I add a review, node--reviews.html.twig is used.
Now, it's possilbe to have different comments types too. I want to add the standard comment (comment.html.twig) for articles, and a custom comment type to reviews.
In Drupals theme naming documentation it's written, to name a template override like this: comment--node-type.html.twig. So I named my comment template comment--node-reviews.html.twig.
Is there anything else I have to do - apart from clearing the cache?
Because I simply cant get it to run.
Enable Twig Debugging, then you'll get template suggestions printed as HTML comments directly into the markup.
I did that and got the following output:
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'comment__field_my_comment_field__article' -->
<!-- FILE NAME SUGGESTIONS:
* comment--field-my-comment-field--article.html.twig
* comment--field-my-comment-field.html.twig
x comment.html.twig
-->
<!-- BEGIN OUTPUT from 'core/themes/classy/templates/content/comment.html.twig' -->
So, the templates are supposed to be named like the following pattern:
comment--field-name-of-the-comment-field-in-the-content-type--content-type.html.twig
comment--field-name-of-the-comment-field-in-the-content-type.html.twig
I'm new to WordPress and it's all complicated to me, but a client has asked I design a WordPress compatible theme for him from the given theme. I've got most of the bits and bobs done but I still don't understand how I'd get wordpress to output custom html in the way I wish... For example, I have this code here which is to be a "widget" on the sidebar, however I can't find out how I'd get wordpress to output a code similar to this so that it'd be compatible with the theme..
<div class="panelfive" id="panel3">
<h4>WIDGET NAME</h4>
<div id="panel2-body" class="panel_body">
<ul>
WIDGET CONTENT
</ul>
</div>
</div>
Usually themes will have a sidebar.php or similar, but it's not really necessary unless you want to make it modular. A wordpress theme is really just PHP, so you can throw that HTML in page.php and it will load anytime a page is loaded.
Check out a couple of references:
General reference for theme development--many pages and sub-pages: http://codex.wordpress.org/Theme_Development
A visual representation of what a wordpress theme looks like, and the related files: http://yoast.com/wordpress-theme-anatomy/
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 ); ?>