In my wordpress blog, I want to make a specific post open a specific link, that is when someone clicks on this post, I don't want the post to open, instead I want to redirect the visitor to a new link that I already know.
Can you please tell me how to do it ?
In other words you want to use one posts teaserview as a teaser for another post... I would recommend not doing it that way even though it is possible. I would rather write a different text in the Excerpt.
"The WordPress Excerpt is an optional summary or description of a post; in short, a post summary.
"The Excerpt has two main uses:
It replaces the full content in RSS
feeds when the option to display
summaries is selected in Dashboard ›
Settings › Reading.
Depending on the WordPress theme, it
can be displayed in places where
quick summaries are preferable to
full content: Search results Tag
archives Category archives Monthly
archives Author archives
"
To also show a different image when in teasermode I would use Custom Fields:
http://www.smashingmagazine.com/2010/04/29/extend-wordpress-with-custom-fields/
http://wordpress.org/extend/plugins/custom-field-template/
Related
In my wordpress page I want to add a feature which will allow me to display post in the browsing loop (e.g. by categories) only with main title and secondary title. By default wordpress engine use title and first sentences from post content.
I've installed a "Secondary Title" title plugin to add a this ability however in my post section I just get First Title:Secondary title and post content below it. How can I change it?
I have a WordPress for my science journalism blog and I would like to add a page that contains a subset of the blog posts. For example, having a page populated by a certain category (i.e. review articles) or tags (i.e. physics).
There seems to be a way to do this by making a new php page, but I am not sure how to get to a blank template to add the code base.
Alternatively, I would prefer having a way to do this without having to mess with the code at all. Any help would be much appreciated. Thanks!
This happens automatically with WordPress; read the docs:
When a viewer clicks on a link to one of the Categories on your site,
he or she is taken to a page listing the Posts in that particular
Category in chronological order, from newest Posts at the top to
oldest at the bottom.
Read https://codex.wordpress.org/Category_Templates
You don't have to make a category or tag template page, but you can if you want to. This is theme-dependent; your theme may already have different archive page templates.
The URL for a category or tag archive page will be:
example.net/category_base/category_name
example.net/tag_base/tag_name
Read https://codex.wordpress.org/Using_Permalinks#Category_base_and_Tag_base
Go to Appearance>Settings>Reading to set number of posts per page and either excerpt or full post.
I think you should be able to get at a category by going to http://example.com/category/mycategory
And to tags by visiting http://example.com/tag/mytag
You should be able to add categories to the main menu, and add tag pages via a custom link OR use a tag cloud?
Hope this helps.
I am working on a WordPress theme that was made by someone before me. The website is for a band, and if you want to see the releases of the band the URL is in this format:
www.domain.com/band/[bandname]/releases/
I am now trying to make a subsection with details of each release. The links from the overview of releases now works, and when the users click the link they get to the URL:
www.domain.com/band/releases/[name-of-release]
The releases are custom post types created with "More Types", and the child content are made with fake pages. A template seems to be loaded based on the slug/page the user is visiting. This is for the 'releases' page:
if ($current == 'releases') {
get_template_part( 'single', 'band-releases' );
}
I have made a template for showing an individual release as well, but how can I get template based on its slug as it will be dynamic (several releases)?
If it's a custom post type, the template that displays the individual releases (www.domain.com/releases/[name-of-release]) is single.php.
The template single.php will also be used to display all individual posts. If you want a template that is just for the releases, create a file called single-releases.php (https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post).
If you name your templates properly, WP will know which template goes with which content.
So I'm attempting to create a dynamic WordPress link that displays within a post which would change according to the subject page that displays that post.
The link is displayed in a Bootstrap breadcrumb list. I'm using the WordPress "Content View" plugin to gather all posts of a given category ex. "Public Space", and display them on a specific "Public Space" page I've created within WordPress.
The dynamic link currently in use displays the proper title of the category of post being viewed, "Public Space", but it links back to the specific category page instead of my "Public Space" page that uses the proper formatting I need through the "Content View" plugin.
Is there any way to accomplish this without creating individual .php page files for each subject?
Any help would be greatly appreciated!
Here's my code for the breadcrumb:
<?php the_category('title_li='); ?>
Link to the website post with the dynamic breadcrumbs:
http://parkerrichard.com/wordpress/public-space/judgement/
Link to the page the "Public Space" breadcrumb should dynamically link to (and change depending on the post category):
http://parkerrichard.com/wordpress/public-space
Thanks,
Parker
Sorry, I didn't read your post fully. Your problem is you're using a plugin to do templating work, when you could edit the "category.php" page to look like you want.
But if you have to use the plugin, then try this:
Go to Settings > Permalinks in your admin menu.
Then set your permalink structure to custom, and put this in the box:
%category%/%postname%
Then underneath that in your category permalink name field, put a single period - .
Now your category permalinks will have: http://yoursite.com/wordpress/category-name/ instead of yoursite.com/wordpress/category/category-name/
They should link up to the right place now.
I want to show the full post with comments and author box on the home page just as if the actual link to the post was clicked. I will set the canonical on the actual post to point to the home page for seo purposes.
I've seen some code out there, but so far nothing that matches my exact needs.
I only want to display 1 WordPress post on the homepage with the comments and author box below the post. And I want to be able to specify which post will be the one that gets displayed on the homepage. (which post id#)
To add to this, I also need the rel="author" to be visible in the header section. I'm using WordPress SEO by yoast and have selected to not show rel="author" for pages. And all code out there I've tried that shows a single post on the home page treats it as if it is a page instead of a post, therefore removing the rel="author" from the head area.
Please do not reply with how to set the number of posts in the Reading tab or how to set a static page. I already know that. That won't work for my needs.
In summary, when I go to my home page I will see the article I wrote along with the comments and author box below it and rel="author" in the header.
Your best bet would be to set your homepage as a static page, and build a custom template for that page. In the editor, create a custom field that allows your to select a blog post to feature (look into Advanced Custom Fields plugin for easy custom fields), grab that custom field value, and use that to build either a WP_Query, or just call the various bits of information using the ID of that post. The trickiest part is getting the_content() by ID. Here's how you can do that:
Add this function to the functions.php file:
function get_the_content_by_id($post_id) {
$page_data = get_page($post_id);
if ($page_data) {
return $page_data->post_content;
}else{
return false;
}
}
Call your function in your page template like this:
echo get_the_content_by_id([INSERT YOUR DESIRED POST ID HERE]);
If you make a php file in your Theme directory called front-page.php, that will automatically appear as the template for your static home page.
Now as far as the rel="author" thing, I don't know anything about that, so I unfortunately cannot help with that.
Also, I'm unsure why my code is losing it's formatting here.