$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>theme development - Cold Fusion to Wordpress|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

theme development - Cold Fusion to Wordpress

matteradmin9PV0评论

I've been tasked with moving a website from cold fusion to wordpress. In the old site there are several templates that are brought into the site via cfinclude. I've coded most of a custom wordpress theme that recreates the look and feel of cold fusion site, and copied relevant html to corresponding pages. However, each page of the site needs its own "sidebar menu", for lack of a better term, and many pages share one or more templates.

Ex: Page A

<div id=sideContent>
  <cfinclude template="local/navtemplate1.cfm">
</div>

Page B

<div id=sideContent>
  <cfinclude template="local/navtemplate1.cfm">
</div>

The solutions I find, multiple custom sidebars and widgets, result in short code, which won't work in the html, and short of making each page its own php template, I can't directly insert php code either. I'd rather not hardcode the html in each page, unless that's the only option.

Maybe this is a pathetic noob question, but I'm not terribly familiar with all the details of either cold fusion or wordpress. Emendation: when I say all the details, I mean every single nitty gritty detail. I can write html and php, I can make themes, etc. But I'm no expert.

I've been tasked with moving a website from cold fusion to wordpress. In the old site there are several templates that are brought into the site via cfinclude. I've coded most of a custom wordpress theme that recreates the look and feel of cold fusion site, and copied relevant html to corresponding pages. However, each page of the site needs its own "sidebar menu", for lack of a better term, and many pages share one or more templates.

Ex: Page A

<div id=sideContent>
  <cfinclude template="local/navtemplate1.cfm">
</div>

Page B

<div id=sideContent>
  <cfinclude template="local/navtemplate1.cfm">
</div>

The solutions I find, multiple custom sidebars and widgets, result in short code, which won't work in the html, and short of making each page its own php template, I can't directly insert php code either. I'd rather not hardcode the html in each page, unless that's the only option.

Maybe this is a pathetic noob question, but I'm not terribly familiar with all the details of either cold fusion or wordpress. Emendation: when I say all the details, I mean every single nitty gritty detail. I can write html and php, I can make themes, etc. But I'm no expert.

Share Improve this question edited Nov 19, 2018 at 18:16 neekMarie asked Nov 19, 2018 at 17:25 neekMarieneekMarie 11 bronze badge 3
  • "I'm not terribly familiar with all the details of either cold fusion or wordpress" - then you're probably the wrong person for this task. I'm not familiar with cold fusion at all, it probably does not matter. The task is to create a WP theme - there are various resources for this, and I would advise for following best practices. The cold fusion code doesn't matter, you can see the page and what you need to recreate – kero Commented Nov 19, 2018 at 17:51
  • Unfortunately, I don't have a choice in the matter. The company I work for rarely cares about those sort of details. I have even been asked if, as a programmer, I can create the graphics for a website. And I have created a theme--I'm just unsure where/how to put these html code templates into the theme. – neekMarie Commented Nov 19, 2018 at 18:14
  • Take a look at stackoverflow/questions/22501068/…, there are a few different solutions if you read through the answers – RiddleMeThis Commented Nov 19, 2018 at 18:16
Add a comment  | 

1 Answer 1

Reset to default 0

You need to learn about the WP concept of Templates and Themes. Themes are how pages are "built" and styled, and take content from the WP database as the page is

Templates are part of Themes, and describe how a page specific page is built.

The database is where all content is stored, including Media (pictures, etc). Each post/page/media item is an entry in the database. A theme will pull data from the database, and format it with the CSS/etc that is contained in the theme.

Since you are new at WP, then the best place to start is the WP Codex. There are lessons there. Plus any number of places to learn how WP works. The Codex starts here: https://codex.wordpress/ .

Dreamweaver is a web server (and a editor), which processes HTML-like code (and HTML/CSS/etc) to build a page. It can include content from a database, depending on how the site is built.

Since the client/employer wants to convert a site to WP, you will need to find a theme that you like, modify the theme, then manually create the content (WP posts/pages/etc). A bit of work; it will be like creating a brand new site. You can't directly 'import' between DW and WP.

So, start with the Codex (and other sources - tons of them via the googles) to learn how WP works. Find a theme you like (which can be a real time sink), modify it for your need (through Customization screens, or perhaps a Child Theme), and start copy/paste your content. Big project. But can be done.

Added after your comment:

If you need to put some content in the sidebar, those are called 'widgets'. You will need to write some custom code that will display whatever you want according to some conditions (page content = something, or day of week = something).

You probably need to start with some knowledge of the Widget API (here https://codex.wordpress/Widgets_API ). Then you can create a widget that contains your custom code to output things into the widget's area on the sidebar.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far