I have a WordPress template displaying the latest posts on the home page (www.mydomain.bla) as it is the default setting in WordPress:
Now, I want to add a link referring to my home page in my navigation (with Appearance -> Menus). The only way I found to do this is by adding a custom link referring to my domain.
Here's my problem:
Even though the link itself does the job, one thing is not working. When navigating to a single post (like www.mydomain.bla/a-single-post) the needed classes indicating the parent link (current-post-ancestor current-menu-parent current-post-parent) do not appear to a custom link like they would to if I had a "Post page" which is not the Homepage.
Is there a way to add a link referring to my posts-showing homepage properly?
Thanks a lot for your help!
Create a new template named "Our blog" and paste the code for posts in this template. Now add a new page named "HOME", select OUR BLOG template and publish the page. Now go to the reading section under the setting tab and change the setting from your latest posts to a single page and select your HOME page.
Now you can add page rather than adding a custom link in the menu.
Related
The problem!
I have a Wordpress site up and running. I wanted to add a custom page, for example if I browse to site.com/mytest it would display just Hello world without any css etc.
What I've tried
I added a mytest.php file under var/www/wp-content/ and tried to browse to it. (The code simply echo a static text).
What I got was simply a 404 page by Wordpress.
To view the file you uploaded, browse: site.com/wp-content/mytest.php
If you just type site.com/mytest , wordpress will thin you are reffering to a page stored in the wp-database. Since it's not you cant view it.
To add the page in the menu, use custom menu and add as "Custom link".
You can make your page a wp custom page template by adding this at the top:
/*
Template Name:Your Page Name
*/
Then create a page in the wordpress dashboard pages and select your page template from the page template dropdown.
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 have found a similar question here: Single Page Navigation Menu Dynamically Generated but I am not too sure how or even if this will work with what I am doing.
I am building a single page theme, in which every time the user creates a new page a new <section id="page-title"></section> is created and filled with the supplied content. I have all that working fine, but I am trying to use WordPress's default navigation. As in when a user creates a new page, it automatically gets added to the nav menu. Right now I have that working of course, but the links point to the page permalinks which I do not want. I need the page to point to a url like '/#page-title'
How can I adjust the wordpress wp_nav_menu(); function to display the # hashtag and the page title for the navigation instead of the permalink?
I'm having a bit of trouble with Wordpress, I want my blog posts to show on the news page, so I selected that page in the settings tab.
The blog posts show but I want to change the page template, I created a new template which works on all other pages but when I select it from the page template list within the 'news' page it doesn't change but instead just stays the same.
There is no blog.php file, I've even tried changing the standard page.php expecting it to be falling back onto that but it is not! I've tried changing the archives page too but nothing seems to change it!
Any ideas?
It won't be page.php which shows a single page view and you're right, there is no blog.php. Wordpress uses a template hierarchy for displaying lists of blog posts.
As you can see from this diagram - Wordpress template hierarchy
For archives like your News blog page you are looking at category.php, archive.php and then index.php (depending on your theme and which template files you've got).
Rather handily your problem is exactly the same as the working example used as a demonstration in the Codex link I've given above, so this should help explain things more.
I looked in documentation but have no clue. My goal is that the main div should contain a featured post I choose and under a set of catgeories in a div, it should display links to posts that include a certain tag. HELP?
You can create a custom page template that outputs the posts as you described using custom queries, create a page that uses this template, then set your site's home page to be this page.