Display articles in Wordpress from a 2nd database - php

I'm looking to move a client to Wordpress, but the current site has a database for articles of which there are more than 2000. The client doesn't want to lose these and the time involved turning them into Wordpress posts will take too long.
The articles have 4 data points that need to be displayed: heading, date, intro and article.
I have managed to create a page that displays the heading and dates as links, with the article id in the link. How do I now proceed to display the article as a post when the link is clicked. It doesn't look like Custom Post Types are what I'm looking for.
My coding skills are very basic and my understanding of Wordpress core is even worse.
Hope someone can shed some light for me.

Related

Custom page show blog posts on tag

Since I am not so great programming in PHP I wanted to ask my question here, hopefully you guys can help me out.
I'm building a WordPress website, this website has a custom page template like custom-single.php.
On that custom template I want to show posts filtered on a tag. And the tag is coming from a Angular value like so {{ctrl.name.tagname}} and yes ofcourse I've made a tag as well in WordPress.
The code must show max 5 posts (fully with title and ofcourse the content), after the posts it must show max 5 items which are older then 5 posts before, but then only with title using a bullet-list.
https://tr.wordpress.org/plugins/display-posts-shortcode/
When you install and activate this plugin called Display Posts Shortcode, you will add the feature that enables you to create text lists.
If we want to list our articles about a label, we can use a shortcode like [display-posts tag = ”tag_name”].
Number of posts to be displayed on one page (eg 20): posts_per_page = ”20 ″
I hope it will be the answer
If your aim is not to learn php but only to solve your problem in your wordpress related project; you can support your question with visuals.
If you say I don't want to deal with the problem, you can get support from any freelance software developer at an affordable price. Sometimes you will be happier soon with this method.

Wordpress one pager: how to structure / posts or pages?

Heyho,
I'm new to wordpress and currently building a website for a client. It's a one-pager and I'm wondering how to build the backend.
Let's say it's a cat-business. And the structure is as following:
Haircutting
Baby Cat Haircutting
Long Hair Haircutting
Special Hair Cutting
Photoshooting
Single Studio Photos
Group Studio Photos
Owner + Cat Studio Photos
Outside Photos
Training
Faster Running
Higher Jumping
Better Mouse-Hunting
News
Contact
The categories 1—5 should form the Menu.
Every entry is (until now) a post and has several custom fields (e.g. Price, Duration, Location…) and that works fine. The Client needs to be able to edit / add / remove the single entries (e.g. "Special Hair Cutting").
How should I build it know?
First Idea
Making Pages for each category, showing the single posts assigned to the
"wordpress category"
Make the Home-Page show all the pages
Second Idea
Building everything in Posts
Building also the categories 1—5 in Posts and figure out how to apply
special CSS (workaround with Custom Fields?)
What is the smarter way to go?
Anyways I'd need further help afterwards, linking the best tutorials, as hours and hours of searching didn't help me any further.
Thanks.
Appologies for my bad English
You can build a simple one-pager by looping through the pages with depth 1 and then through each of their subpages. You can use the get_pages function for this.
Make sure to redirect the individual pages to an anchor on your one-pager/home (with a redirect plugin). This will prevent people from finding your individual pages through the search engine.
How get_pages works: http://codex.wordpress.org/Function_Reference/get_pages
How to loop through your (sub)pages: http://wordpress.stackexchange.com/questions/93844/child-pages-loop‌​

Navigating through custom post types in WordPress

I want to redesign my website using WordPress (as CMS) and Bootstrap (as front-end).
Now, I've been pretty successful at doing so, but I have one specific problem.
I have a tutorial website and I want the navigation structure to look like this :
If the user is on my 'website-name/tutorials' then display to him all of the tutorial series titles in an unordered list (so for example C++, XHTML and CSS - but not individual tutorials in each series)...
If the user clicks on some specific serie, then display an ordered list of the elements (so, if he clicks C++, then URL will be 'website-name/tutorials/cplusplus' and he will be able to see all of the tutorial in an ordered list).
If the clicks on one specific tutorial, then the URL goes (for example) 'website-name/tutorials/cplusplus/installing-the-program' and user gets all the content related to the tutorial.
Now, I have been experimenting with this and concluded that the best solution is to create custom post type named "Tutorial" and then make every single tutorial that post type.
However, since on 'website-name/tutorials/cplusplus' I want to display the list of tutorials in "C++" tutorial series and on 'website-name/tutorials' I want to display only the tutorial names, I don't know how to do that.
I tried to do that using Hiearchical posts (so, for example, I made a parent post named "C++" and it's children were all of the tutorials in the C++ serie).
However, I have a problem with that, because my C++ tutorial series has 100 tutorials, but it shows me 101 list elements (I made the website display all the custom post types in an ordered list), with the first one on the list being C++ (the parent post).
So, I'd like to echo the series name only on the 'website-name/tutorials' not on the beginning of the list.
I researched and people seem to use archive in custom post types, rather than parent/child system for this kind of navigation.
I just wanted some of the WP experienced users here to tell me, which is the better solution for my problem? Dealing with these parent/child problems or switching from parent/child posts to archive posts?
If I understand fully perhaps using standard posts and categories will do the trick? Your '/tutorials/' page can display the full list of all posts and when a user clicks on a specific category (e.g. C++) only the relevant posts will display.
You can use the following code to list posts of a specific category:
<?php query_posts( 'cat=20' ); ?>
Changing "20" with the chosen category ID.
Hope this helps!

Drupal route based node content

I'm new to Drupal and have a basic question which I cannot find a good answer to. I am trying to dynamicly determine the contents of my website based on a selection made by the user and keep the selection displayed in the routing for SEO purposes.
It's a website for a Restaurant with multiple franchises.
What i'm trying to do is the following:
The user visits my website and gets a splash screen presented with the available franchises or a textbox to enter his postalcode
Upon selecting he enters the main website with the navigational structure adapted to the selected franchise. For example: domain.com/city/, domain.com/city/menu, domain.com/city/menu/dishes, domain.com/city/contact, ...
The contents of all nodes are based upon the city the user selected. Some franchises have extra nodes which should be displayed in the main navigation aswell.
What I have thought about so far is to try to accomplish this with taxonomy but I really have no idea where to start. Parts of the nodes will be the same for all franchises other parts will be different. Menu item prices will also be different.
This is the first website i'm building using Drupal so any advice is welcome.
Thanks!
It will be impossible to explain it all here but yes it is possible to select your content based on user input in Drupal. You will need to look into Views & Panels.
In Views you can use arguments to narrow to a specific taxonomy. With Panels , an argument can be retrieved fron the URL and passed to the Views in order to display the results.
There are a lot of resources available, Merlin of Chaos, the author of the Views & Panels modules has written a book about it. There are video tutorials online. Your best bet is to start with drupal.org.

Simple CakePHP Portfolio

I am building a very simple website ( http://driz.co.uk/beta/ ) using CakePHP to show a portfolio of my work as well a few pages such as about me and contact. I was thinking of just creating each item for my portfolio as a page inside the /views/pages/ folder but seen as I'm wanting to learn a bit about CakePHP I thought it would be probably better to use a database and store each item in a simple table.
What I need to do is have a simple page like /portfolio/ which lists all my work to date and then links to each item I have so for example /portfolio/my-awesome-work/
I also need to list the items in the sidebar as shown in the link.
For each portfolio item I will need a title, a body (which will store the content and images for each item) and also the client information. I don't need any image upload capabilities as I will be just adding the HTML for it in the database table.
If anyone can help it'd be much appreciated.
Thanks
Hopefully you aren't asking for a full solution (frowned upon on SO)
First follow the blog tutorial : http://book.cakephp.org/view/1528/Blog
This is a great place to start as it walks you through all the basics.
As for your particular problem. Creating a portfolios table with all the fields you mentioned and baking the code (you'll know what that means when you follow the tutorial) as a starting point will get you half way there.
You could also add in an admin area to manage your system. This would mean you'd need to create a users table and add the Auth component

Categories