Manage custom content blocks on a page - wordpress

I'm putting together my own Wordpress theme for a very specific set of client requirements. I'm fine with front-end theme work, but I need some help with back end.
The task is kind of like a support site, with lots of Q and A's. I'm building a support site for a company, which means most Pages will be populated with many questions and associated answers.
The page Structure would be something like this:
Home Page (with links to Most recent Q+As added) and common sections
-How to use the app (10-20 Q+As on page)
-How to manage integrations (10-20 Q+As on page)
-Other page (10-20 Q+As on page)
-5-10x 'Other pages'
About Us
Contact Support
Requirements and my comments
-Each Q and A does not have it's own URL
This makes using Posts for Q and A's unattractive.
-Each Page is made up of a Table of Contents which allows quick scrolling to questions
An ideal solution would be some code on the page theme template which grabs each "Q and A" object within a certain category/section/identifier and load it to the page
-New questions and answers can quickly and easily be added
The ideal solution for support reps is that they can add a question and answer, and assign a category, rather than edit a huge page of questions.
-Order of Q and A's on page is important
Ideal solution should allow you to order the Q+As within their given category/section/other.
-On the home page, most recent Q+As added list exists
-Each Page of Q+As has a "last updated" date, which is the date the most recent Q+A was most recently modified.
Ideas I had
Posts or custom posts seemed like a good idea, but they create permalinks. But my "Pages" would actually be Category Archive pages. We don't want a Q+A to be be assigned two categories. Also, custom post ordering seems difficult. If we could suppress permalinks and ensure on category or section and find a way to order them - this could work.
FAQ Plugins
It seems like these all are a bit clunky and the amount of custom dev to re-skin on it might not be worth it, might be easier to do something totally custom.
Question:
does anyone have any ideas how this could be achieved?

The best thing is to use custom post types. Basically two custom post types, question and answer. Then each question can have categories tags and so on. Answers can have a custom field with question ID so you can easily get all the answers by question ID. If you need then not to have unique url, than create two files: single-question.php and single-answer.php and put 404 page code there so if user will get to the url of a single question or answer than he will see 404 error :)

Related

Wordpress post view format for filter grid

I am a complete newb to wordpress. I am trying to help a friend out. She asked me to help her move her wordpress instance to another hosting provider.
I have done that for the most part. My issue is the original provider implemented a not-so-obvious way of an isotope filter on some UI elements.
Specifically the object is a company. Each company has a logo, the name of the company, a short description and a contact name / email.
These companies service states / areas and the idea behind the page is to select the state and only the companies for that state are visible.
From the brief searching I have done - there seems to be an overwhelming amount of plugins to support this.
I have tried creating a simple post with a featured image and adding in the text in the excerpt.
My problem is the links. I don't want the links to go back to the post - rather I want the links to go to a custom URL.
Is there a plugin that will allow me to define a custom post type (to include categories) and then filter on it similar to Isotope type of filtering?
There are many free plugins but if you are using the Elementor page builder. I am not advertising my product but as I saw your requirement matches a plugin that I am selling in the market.
The frontend filtering feature is not yet available to the released version but will be released soon. It basically allows you to build a custom grid as you like.
Is it something similar?
https://demo.geekygreenowl.com/elementor-387/
You have to create a custom post, there should be a custom field(custom URL) as well.
Or, You may create a WordPress query. https://developer.wordpress.org/reference/classes/wp_query/
also, coding will be required for filtering

Concrete5 Custom Content Types (Blocks)

Is there anywhere online where one can find how to create custom blocks in the same way we can create custom content types in Wordpress. The desired result is to add a block that will allow the user to add/edit custom fields like client name, portfolio description, portfolio thumbnail.
I've created a free tool called "Designer Content" that lets you easily generate these custom blocks:
http://www.concrete5.org/marketplace/addons/designer-content
That being said, it is important to understand this key concept: In Concrete5, everything revolves around PAGES. In general, you want to try to establish an architecture where each piece of data is represented on its own page (a "details" page, which would roughly equate to a single blog post in Wordpress). Then you use the Page List block (usually creating a custom template for it to modify its look) to list out titles, links, and excerpts/photos from each of those "details" pages on a top-level "index" page (roughly equivalant to the home page or category archive in Wordpress).
For example, if you're building a portfolio site, you might want one top-level "Portfolio" page that shows a thumbnail and title of each piece, then a "Portfolio Item Detail" page type that contains one piece per page -- each living underneath the top-level "portfolio" index page.
The benefits of this approach are C5 gives you out-of-the-box tools to manage your "data" (pages) in this way -- users can add, edit, delete, and rearrange the pages via the "Sitemap" in the dashboard. Site search works without any modification -- each page (i.e. portfolio piece) will be its own search result with a link to a specific page. Also you then have more fine-grained control over access permissions if you ever decide to restrict access to only certain groups of people (registered users, etc.).
If you take this approach, you might find the "Page List Teasers" addon helpful (it will let the Page List block -- which you're using for your top-level "index" page -- to show actual content excepts from the pages instead of just a separate "description" field):
http://www.concrete5.org/marketplace/addons/page-list-teasers
Or if you want to dive deeper and customize the page list template even more, I have a starting template with a ton of code comments in it explaining how to do different things here:
https://github.com/jordanlev/c5_clean_block_templates/blob/master/page_list/view.php
But... if you're only talking about small amounts of information and you think a separate page for each one is overkill, then the Designer Content approach I linked to first will work just fine.
You can find a HOW-TO on creating new blocks written by Franz Maruna on the concrete5 website.
Here is the link: Creating a New Block Type
There is also a simple block you can download and install to help you follow the developer tutorials. You can find that here: Simple block template

Post privacy in Wordpress

Can a post be hidden from home page, archive view, category lists etc. and viewable only if you have a direct link to it? The blog doesn't have registered readers and is open to public so that would be a mean of hiding some posts from public view without using the password protection.
I asked this question in Wordpress section and the idea there was to use conditional code so I'm asking the question here as well to get closer to the code.
If I used conditioning, would I have to input each post's ID separately to PHP file for archive, categories, search and such?
EDIT:
After reading a bit more all over, I had an idea of creating a private category and then use some kind of conditioning so that posts from that category are hidden. According to Codex, certain category can be hidden from, for example front page but I don't know if there's a way to hide it altogether except when you have a direct link.
Creating a "Private" category is a good solution. It is quite possible to hide this category altogether except via direct link. You just have to "block all the exits" with conditional code.
The default WordPress theme displays posts via the Post Loop. See http://codex.wordpress.org/The_Loop, especially the section entitled "Exclude Posts from Some Category". Just find all the places in your theme's PHP files (e.g. index.php) where this loop is used, and add the conditional code. You'd also need to filter your category list and blog archives in the side menu. Don't add filtering in single.php, otherwise the private post won't display on its own page.
You'd probably want to add a similar condition to filter search results so that private posts aren't leaked via the blog's search tool. There may be more "exits" I haven't thought of, but I'll be sure to update as I do. I'm glad to look at specific code if you so desire.
Understanding WordPress' post query and loop really opens up a world of possibilities for customization.
I found the simplest way - just use Simply Exclude Wordpress plugin. It has the option to exclude each post (or tag, for that matter) from front page, archive, search or feed. It works flawlessly. You can still view the posts by using direct links.
(Not actually an answer that includes code but a working solution nonetheless.)

WordPress: Isolating posts on a certain topic, to one section of a site

First, I've only programmed a lot of HTML, know a little PHP and am playing with Wordpress, experimenting and learning it the way I learn everything else, trial and error, heavy on the error.
The subject line isn't very clear I'm sure. I have a site set up for writing. The posts act as categories and to a Page menu for static submissions. All posts, in the theme show up on page 1, 2, etc. Great.
What I'm trying to figure out and want is this. I want a separate section of Posts just for one topic, in this case movie reviews. So the main section of the site is general posting. I want a separate section where users can post to their hearts content but have those movie posts REMAIN in one section and not be mixed in with the "general population." Ok, they click on the Movie Review link on the main page. This takes them to the Site Admin where they can write a review in TinyMCE and Publish it. IS there a way that these Posts can show up in a section of their own?
I've even installed a second WP site for this purpose. Wonderful, but now I have to transfer all registered users there and any new ones. That's insane. Plus, the user would have to log in twice, once for the original and once for the Movie WP. Also unacceptable.
If I'm on the wrong site to ask this question, let me know and my apologies. Otherwise, some guidance would keep me from my endless Google search.
You can use Categories to mimic this. So your movie reviews would be at mysite.com/category/movie-reviews/. You would then modify index.php to exclude the movie reviews category from the main page.
If you're comfortable with using php, you could instead use custom post types. This is a better solution, but would require more custom coding. The bottom of the Codex page I linked to has some excellent walkthroughs on using CPTs.

Organising Custom Content for Wordpress

I am already very confused as I am typing this thread out. Please forgive me if my query is a little too difficult to understand.
I have an existing Real Estate Site that I intend to move 100% into WordPress. The existing site has one backend for listings and another blog section for reviews.
You can probably see why I have decided to make the move to a full WordPress powered site. Maintaining both ends of the site is both tedious & cumbersome.
I have read and understood Custom Post Types & Custom Taxonomies and how they work. I am rather excited about implementing them. However there is some content I am finding difficult to organise.
* An existing database table of about 4,000 Condominium Projects
Each entry in the Condominiums table has some "bio-data" like Year Completed, No. of Units, Facilities, Amenities etc.
Currently each listing in my site has an ajax query that fetches information from this table on demand.
In the new site, I intend to have a link to the respective condominium in each property listing.
This link should display information about the specific condo and display 'results' of matching listings.
Also, some condos have long article reviews done for them. In my current site, these reviews are displayed in the blog section. Separated altogether.
So here's my question.
How would I connect everything together. A duplicate perhaps? Taxonomy & Post for each condo? That will mean over 3,000 unique entries. Wouldn't that be an "overkill"?
If it is a taxonomy, the link will probably display all posts (listings) that have that condo name. But it wouldn't link to an actual page of either it's review or bio-data.
Any thoughts will be very much appreciated... Please feel free to ask if I have missed out any vital information!
Thanks in advance
The seems very straightforward to me and a perfect fit for WordPress (and I shudder to think of doing anything in Drupal you don't have too; and this from someone who developed in Drupal for 2+ years...)
Anyway:
Each condo gets stored in a custom post type.
All the "bio-data" gets stored in a custom field. Alternately you could create a taxonomy called "bio-data" and have a term value for each of the options but this won't work well for things like "SqFt" unless you do ranges (i.e. 1200sft-1300sqft) because terms can only be used for "true/false" attributes (i.e. either it applies or it doesn't) and not for specifics like exact offer prices, etc.
The long articles can just be stored in the "content" section of the condo post type (unless you have multiple per condo then you can either store in comments as #Jan Fabry suggested or you can create a custom post type "review")
Like I said this is really straightforward. Of course I've lived and breathed database apps for 20+ years so it comes second nature to me. Any questions, just ask...
This was how I managed to solve my own question!, Ironically enough, MikeSchinkel had an almost identical answer, so I accepted his answer instead.. So here's what I have:
A Custom Post Type for Condominiums labelled 'Reviews' in the admin section. The property 'Bio-data' is in custom fields. This Custom Post Type has a rewrite rule:
array( 'slug' => 'condominium' );
That way, I managed to have each Permalink to show something like:
http://domain.com/condominium/post-title
I have added a page called Condominiums and had it set to use a custom template - which basically shows the latest posts of condominiums with reviews. I also intend to extend the template for it to show a Search Condominiums function.
Added relevant taxonomies that can be searchable - like Brands & Developers.
I have already converted previous reviews to this. The last thing I will have to do will be to post all the Condominiums from the condominiums database to the wp_posts table using this Custom Post Type.
This is the part I am crossing my fingers for as I will have to see if the rewrite rules are going to significantly slow down my site as this will be 4,000 entries. This issue has been recently brought to my attention here
http://core.trac.wordpress.org/ticket/12935
I will update this thread once I have completed the importing - since this is the only place I have posted a question and have it answered - if anyone might be interested!
Thank you for your suggestions. I hope this helps someone else who is in a similar predicament.
Would it work if you view the Condominiums as posts, and the reviews as comments to these posts? This would keep them together, and is conceptually not even too far from the original intention. You can put the extra information in custom fields and tags (which gives you free searching capabilities). Then you should see for yourself if you still need to create a custom post type, or just do it with regular posts (why not?).
But yes, you are stretching the original WordPress concept a little. Drupal or some other CMS might be a better option, and have more plugins that are suited to your situation.

Resources