I'd like to change the layout of the listing page of a business directory so that it looks similar to this layout, http://pastebin.com/1aHenCCN, using the same Wordpress theme.
I will modify single-listing.php page (at minimum)
Could someone help me with this? I know that I may need to pay for this.
listing page of all listing post type is archive-listing.php ,
Single page of individual listing post type is single-listing.php. So you need to modify archive-listing.php for to effect entire listing page.
Assume that listing is your post type .
Related
I want to use WP for a site that blog is just one aspect of it, and I don't want requests to home_url list blog posts (post_type=post), I want them be to fetched using another URL.
This topic default-archive-url-wordpress suggest two ways:
page_for_posts option
post_type=post URL query parameter
but I have questions
About the first, How a page would be able to loop into the posts, and where I should update this option (which hook)?
For the second, the guy says that using this param, make the wordpress get the archive for the specified post type, but I think posts don't have archive (according to includes/post.php their has_archive is left to default) how should I change this and also I want to use a permalink/pretty link for accessing posts.
Thanks in advance
Go to settings -> reading, and change the front page displays posts settings to front page displays a static page and then select a blog page.
Easy as pie.
Is it possible to show posts by categories/tags on the index page instead of taking the user to the tag.php and category.php pages?
For example, when the user clicks the 'Uncategorized' category, I would like all the Uncategorized posts to replace the list of posts already there on the index page.
I've been trying to find out if anyone has done this but I've had no luck. I'd really appreciate it if someone could give me a link to somewhere that tells me how to go about doing this or lets me know how to change the code to get this to work.
This can be done. I can not recall a page that has done it but I do know it would require you creating your own custom page template.
http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates is a good place to start learning how the page templates are created.
Some additional links
http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query
http://wordpress.org/support/topic/tag-archive-from-a-single-category-is-this-possible?replies=34
For a project of mine I need to define an alternative template for single posts.
To be more specific I need each post to be displayed as usual when the website is browsed but I need to create different single pages reachable from different URL to create a sort of a mini-website for each post.
(I'm actually using the WooCommerce plugin and what I need to do is to create a mini-website for each product. This needs to be something "outside" from the main website, with a complete different graphic template and is going to be reachable through a QR-code).
Hope it makes a bit of sense.
Thanks for your advices and/or suggestions.
Angelo
I think the easiest way to do that is by registering a custom post type for the special posts that get this special "single.php" template. Then, you can simply write a new single template titled post-[custom post_type].php. Any post you register of this type will use that template.
OR...
If you don't actually need them to be posts, it's even easier if you publish them as pages. By default, pages let you assign a specific page template in the edit screen. So you could make any number of custom templates. Just make sure you add the special header:
/* Template Name: Custom Page */
...so WP knows it's a page template.
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.)
I'm implementing our school's website using WordPress as CMS. So far, it works well and I'm 80% done. Our website is basically 11 WordPress pages and a blog.
Now, there is one feature i'm not sure how to resolve. We want to have "testimonies" of past students to be displayed across WordPress pages, in a specific area of the page. They will either be videos or written text with an image.
They will be embedded on regular WordPress pages either a specific video for a specific page, or just random testimony video for a given page.
Is it possible to do that with WordPress? If so, how?
Thanks for any hints.
Alex
There are quite a few Wordpress plugins which handle testimonials gracefully:
http://wordpress.org/extend/plugins/search.php?q=testimony
You should be able to do this with categories. Create a testimony category and and then create a new template called 'testimony-page.php'. In that template, put a separate loop that pulls a random testimony from the database. Voila, page in a page.
If you feel like building this yourself, it can be handled with custom post types. Here is a great guide that will give you a lot of useful information: http://www.smashingmagazine.com/2012/11/complete-guide-custom-post-types/
I like to use this plugin:
http://wordpress.org/extend/plugins/more-types/
To manage my custom post types.
To query posts from a new post type, use something like:
query_posts({
'post_type' => 'testimonials'
});
So, if you wanted to add testimonials to your site, you'd query them like above with whatever parameters you need, and do a simple loop to output the posts.