Recreating the Classic Wedding WordPress Theme Homepage With the Block Editor

Category Image 052

I simply do not understand it. For at least the better part of a decade, theme authors have asked for the tools to create more complex layouts with WordPress. They have asked for the ability to allow end-users to more easily recreate their demos. They have wanted methods to bypass the “restrictive” theme review guidelines.

Over the past couple of years, WordPress has consistently delivered features that theme authors have asked for. Yet, themes that use them are few and far between.

During my weekly perusal of the latest themes to land in the directory, a new wedding theme caught my attention last week. Of course, I downloaded, installed, and activated it only to find that I had no idea how to recreate the homepage design. There were no instructions. The theme options in the customizer seemed to make little sense. Nearly all of the decorative images were non-existent in the theme folder.

Did I need to upgrade to the pro version to get what was in the screenshot? There seems to be a plan for such a version, but it is not available yet.

Screenshot of the Classic Wedding WordPress theme.
Classic Wedding theme screenshot.

I am no rookie, but I was stuck. I liked the simplicity of the design. However, I could not imagine setting up a wedding site with this theme. From a user’s standpoint, it should not take more than a few mouse clicks. After that point, it should only be a matter of customizing the content.

I recognize that there is still a sort of love/hate divide for the block editor in the inner WordPress community. However, theme authors are not doing any favors for the overall WordPress user base by not taking advantage of the tools available.

So, I recreated the Classic Wedding theme homepage from scratch. Using the block editor. With a theme that supports it.

Creating a Wedding Homepage

My goal was simple. There was no demo to work from, and all I had to go on was an 800-pixel wide screenshot from the theme page on the author’s site. Like I recreated the Music Artist homepage several weeks ago, I wanted to do the same for Classic Wedding. With a couple of exceptions, which could have been handled by the theme, I was successful.

Because Classic Wedding does not support the block editor itself, I could not recreate its homepage via the block editor while using the theme. It was not happening — I tried. I knew that the Eksell WordPress theme had a “canvas” template that allowed users to edit the entire page, so it was an easy choice.

I also loaded the Kaushan Script and Lora fonts to more closely match the original theme. This was unnecessary for the experiment, but I wanted my recreation to at least look somewhat similar.

I immediately knew that I would have one hurdle to overcome. The theme used an image that overlapped both the section above and below it. This requires margin controls, particularly the ability to add negative margins. Unfortunately, this is a missing component of the block editor today. It does not mean that theme authors cannot do it with custom block styles or patterns. It simply means that end-users are unable to control it from the interface.

Because I did not want to spend my time writing the code for this, I leaned on my usual safety net, the Editor Plus plugin. While it can be a little clunky sometimes and feel like overkill, it does include those missing features like margin options.

Using the Editor Plus plugin, adding a negative margin to an image in the WordPress block editor.
Adding negative margin to an image.

I used px units there because it was easy. In a real-world project, % or rem would have been better. But I was just doing a quick proof-of-concept.

Everything else in the content area was straightforward. I needed a Cover block with an Image, Heading, Paragraph, and Button tucked inside. I needed a Group block as a container for Image, Heading, and Paragraphs in the bottom section.

Because the theme did not package its decorative images — again, how would users recreate the homepage without them? — I opted for a simple striped SVG background instead of the flowers in the original. Since I already had Editor Plus installed, I added an SVG from Hero Icons as the main background.

Content area of a wedding homepage design with a hero header, overlapping image, and text.
Wedding page content recreation.

My original idea was to recreate the “content” part of the homepage only. However, it was a bit boring on its own. Therefore, I transformed everything into a Columns block and added the sidebar. I recreated the primary elements using the Image, Heading, Paragraph, and Navigation blocks. Then, I added a Social Icons block for fun.

Full wedding page design with sidebar and wedding photos/content on the right.
Full wedding homepage design.

I did hit one snag with the Navigation block. WordPress does not currently offer a method of centering each link in the list when using the vertical block variation. I had to write a couple of lines of CSS to make this happen. This seems like an oversight and one area where the block editor failed to meet my expectations. Of course, this could be handled on the theme side of things.

Overall, this was a relatively simple project. However, this experiment added some complexities that were not present when I recreated the Music Artist homepage. Margin controls and vertical Navigation block alignments are must-haves. Using a third-party plugin and writing custom CSS is not ideal, and these were requirements to make this happen straight from the editor.

All of this is possible from the theme end. Each piece of this design could have been packaged as a block pattern. The overlapping image effect would have made for a neat block style. I just wish that theme authors would start utilizing the features that are being hand-fed to them.

How to Improve CSS Performance

Featured Imgs 25

There is no doubt that CSS plays a huge role in web performance. Milica Mihajlija puts a point on exactly why:

When there is CSS available for a page, whether it’s inline or an external stylesheet, the browser delays rendering until the CSS is parsed. This is because pages without CSS are often unusable.

The browser has to wait until the CSS is both downloaded and parsed to show us that first rendering of the page, otherwise browsing the web would be a terribly visually jerky to browse. We’d probably write JavaScript to delay page rendering on purpose if that’s how the native web worked.

So how do you improve it? The classics like caching, minification, and compression help. But also, shipping less of it, and only loading the bit you need and the rest after the first render.

It’s entirely about how and how much CSS you load, and has very little to do with the contents of the the CSS.

Direct Link to ArticlePermalink


The post How to Improve CSS Performance appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

How to save telnet output logs to a text file

Category Image 041
           hi guys please I want to save the output logs to text file I run this script but does not work . the error show me in last 3 row
       import sys
        import telnetlib
        import getpass
        #####################
        ###### Define Host
        host=["192.168.1.164","192.168.1.169"]
        devno=len(host)
        user='ali'
        Password='cisco'

        for i in range(devno):
            print('*'*50 + ' Connected to device : '+str(host[i]) +'*'*50)
            tn=telnetlib.Telnet(host[i])
            tn.read_until(b'Username: ')
            tn.write(user.encode('ascii')+ b'\n')
            tn.read_until(b'Password')
            tn.write(Password.encode('ascii')+b'\n')
            #tn.write(b'enable' + b'\n')
            #tn.write(b"\n")
            #tn.write(b"terminal length 0\n")
            #tn.write(b"show run\n")
            #tn.write(b' show ip route\n')
            tn.write(b'  exit\n')
            print(tn.read_all().decode('ascii'))
            f = open("/home/onelabad/Desktop/output.txt", 'w')              error start from here
            f.write(print)
            tn.close()

Create your next Web API in SQL

Category Image 006

My CTO is a kick ass SQL guy, but he doesn't know much C#, so wrapping his SQL into a Web API is difficult for him. Every now and then he throws me some SQL statement or Stored Procedure in our Teams chat, and asks me to wrap it into an HTTP endpoint for him, because one of my colleagues needs it for our frontend parts. The process is almost the exact same every single time.

  • Wrap the SQL into an SqlQuery invocation using Entity Framework
  • Create some sort of view model matching the return from the Store Procedure
  • Choose which roles are allowed to access the endpoint
  • Parametrise the SQL invocation
  • Execute the SQL and return the content as my view model

Realising I could completely automate this process using Magic, providing high level UX components doing the entirety of the job, resulted in the following click button solution.

Not Your Typical Horizontal Rules

Category Image 052

The default browser style for <hr> is so weird. It’s basically:

border-style: inset;
border-width: 1px;

The default border-color is black, but the border doesn’t actually look black, because the inset border “adds a split tone to the line that makes the element appear slightly depressed.”

If I kick up the border-width to 40px you can see it more clearly:

I often reset an <hr> to be “just a line” and it always gets me because I’ll try something, like height: 1px with a background at first, but that’s not right. The easier way to clear it is to turn off all the borders then only use border-top or border-bottom. Or, turn off all the borders, set a height, and use a background.

Annnyway… Sara has some of the nicest horizontal rules in town on the current design of her site, and she’s written it all up. Guess what? They aren’t even <hr> elements! It turns out the only styling hook you have is CSS, which wasn’t as adaptive as Sara needed, so she ended up with a <div role="separator"> (TIL!) and inline SVG.

The best way to get the full flexibility of an SVG is by inlining it. But the <hr> element is content-less — it has no opening and closing tags within which you can place other elements.

The only way to work around the limitations of <hr> while preserving semantics for screen reader users is to use a div and provide the semantics of an hr using ARIA.

Direct Link to ArticlePermalink


The post Not Your Typical Horizontal Rules appeared first on CSS-Tricks.

You can support CSS-Tricks by being an MVP Supporter.

How to handle “statement label must be unique” in Marie assembler

558fe5180e0e8fc922d31c23ef84d240

here is my code...

JnS Print
            Halt

Print, HEX 2
PrintString, Load PrintName
Skipcond 800
JumpI Print
Output
Clear
Load PrintName
Add Increment
Store PrintName
Clear
Jump PrintString

PrintName, DEC 0
HEX 043
HEX 048
HEX 045
HEX 041
HEX 048
HEX 030
HEX 030
HEX 030
Increment, DEC 1
Load PrintName
Store Print_Arg
JnS Print
Halt
PrintName, hex 04A

Print_Arg, DEC 0
Print, Hex 0
Load Print_Arg
Output
Skipcond 000
JumpI Print
Output
Clear
Load PrintName
Add Increment
Store PrintName
Clear
Jump 0

Increment, DEC 1

read a closed Excel.xlsx file

558fe5180e0e8fc922d31c23ef84d240

I wish to read from a closed excel file, a few years ago I found a website using ADO and it worked
but now I cannot find this website I have tried over 100 with no success

please help
Ernest

Countdown timer using LC3 Assembly Langugae

558fe5180e0e8fc922d31c23ef84d240

I want to make a timer that will countdown from a number that a user will give such as 20 min. If it is easier I could use the timer as a set amount each time. I want the timer to countdown from 20:00 down to 00:00 (min:sec). I want users to be able to pause and start the time by pressing a s for start and a p for pause. If you have any questions let me know, any help will be greatly appreciated.

May I Know where is my mistake

558fe5180e0e8fc922d31c23ef84d240
#include<iostream>
using namespace std;
int main()
{
  string weekday;
  weekday= {"Mon","Tue","Wed", "Thu","Fri"};
  cout<<"\n Please select day of booking:";
  cin>>weekday;
  cout<<"\n Day of booking:";

  return 0;
}