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.
Related
I am working with a plugin that autogenerates a page in Wordpress.
The "Event" plugin creates a new page with slug "events". The page is not registered in the "list of pages".
I need to add the events page to the main menu.
My problem is when I go to the appearances->menu, there is no element in the list of pages to add to the menu. The only way to add the item is to manually create the link in the "custom link".
If I'm going to do this, is there any way to parameterize the baseurl? for example: instead of using link "HTTP://homepage.com/events", I'm looking for "{{ base URL }}/events"
Is this possible? if so, how?
Thank you
I purchased a WP theme https://themeforest.net/item/pressville-municipal-wordpress-theme/19949423 and need to add general content area to the People page: https://preview.themeforest.net/item/pressville-municipal-wordpress-theme/full_screen_preview/19949423?_ga=2.67243158.624148492.1570058772-1881232054.1569979687
The People page is actually a section in the WP dashboard (kind of like Media or Portfolio section) so technically not a editable page in the WP backend. I contacted the theme creator and was told that it's customization (not included w/theme) and advised to hard code text into the php. The problem with that is it's not accessible to other users who have no design or code background.. Is there a way to create a page with editable content block for this People section so it's easily editable without knowing code?
Also, the “People” header text changes if you click on subcategories (to “Elected Officials”) for example. When you click a subcategory, the main menu (People page) no longer shows as active which can be confusing to users. Is there a way to fix this so header stays consistent (like Contact page header) and menu item shows active regardless of what subcategory(All, Elected Officials, etc) is selected on the People page? Thanks.
You can create a regular page called "People's page" and add text to it. Then if you want to show that page's content into a PHP template you can do the following:
Step 1. Create the Function
Open up your theme’s functions.php file and paste the following code, likely at the bottom of the page.
function cn_include_content($pid) {
$thepageinquestion = get_post($pid);
$content = $thepageinquestion->post_content;
$content = apply_filters('the_content', $content);
echo $content;
}
Step 2. Use the Function in a Template File
Next, open up the specific template file you want to include the Page’s content on and paste in the function:
<?php cn_include_content(31); ?>
Replace 31 with the ID of the Page you want to include. How to find a page ID.
Is sounds like you need to go to your wp-admin and click appearance/ menus. Here you can remove these menu items that might be default but have no pages associated with them. You can then add the pages you want and come back and create a custom menu. Hope that answers the first part of your question.
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.
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.
I am trying to achieve a custom URL structure with Wordpress. Basically, my site functions as my blog and my portfolio. I want to have an "Articles" section and a "Portfolio" section. I want the articles to display on the Articles page, and the portfolio on the Portfolio page. Should be easy, except on top of that I want custom URLs...
I want the URLs setup like this:
Articles page:
http://mydomain.com/discusses
Specific article:
http://mydomain.com/discussed/%postname%
Portfolio page:
http://mydomain.com/does
Specific design:
http://mydomain.com/designed/%postname%
I can figure out how to do only one rewrite of this type, but WP doesn't have built in functionality to do both. I'm just wondering where I should start or what I should do...
The problem also becomes, I want to retain category functionality in both areas, so maybe it needs to be achieved with Custom Fields? and add a new rewrite rule based on the custom field of a post? I have idea where to start...
Thanks for any help you can give.
This actually isn't that hard to do. I'll go down, page by page, what you would need to do to achieve this.
Articles Page
Create a new template in your theme folder (/wp-content/themes/your-theme/) called discusses.php and just add the following content:
<?php
/*
Template Name: Discusses Template
*/
?>
You don't need any more content. Go into the Pages section of WordPress Admin and create a new page called Articles page and set the URL to be /discusses/. Set the template of this page to be Discusses Template. Now, go into the Settings → Reading section in Admin and set the Posts page to Articles page. Now all your blog posts will appear under the URL /discusses/
Specific Article
The easiest way to have all your articles appearing as /discussed/title is to rename the default category (in Posts → Categories) to discussed. Then set your permalinks to be:
/%category%/%postname%/
This will render the links you need for each post.
Portfolio Page & Specific Design Page
Assuming this will be some kind of custom design, the easiest thing to do would be to create a custom template and Page in the pages section, as you did for the articles page, and throw your custom HTML and CSS into that. I would then set each specific design page to be a child page of that in the pages section. You can use the WPdb classs to make custom queries to populate the Portfolio page.