How can I create a wordpress detail page? - php

I've a Wordpress site page (5.7 version) called Ranking with all athletes showed (url = "https://example.com/ranking").
For every athletes showed I create a button link for display all athlete details.
What I would like is that by clicking button (for example athleteId=2352), the page to open will be = "https://example.com/athlete/2352.
How can I create athlete page?
Do I change only permalink?
Do I Have to rewrite my theme rules?
Thanks

Look into creating a custom post type for the purpose. You should then have control of rewrite rules, archive slug etc.
https://developer.wordpress.org/reference/functions/register_post_type/
And as ed2 mentions, please be more clear in your questions. It makes it easier to help out, and more useful for others with the same issue as yourself

Related

How to change a URL for a specific page in WordPress?

I'm not talking about site URL.
I mean like changing from mysite.com/our-team/john-doe to mysite.com/our-volunteers/john-doe
I just want to rename the /our-team/ to /our-volunteers/. There's only one john-doe page. Now, John Doe is NOT our team per se, but he's a volunteer. So, I need to change the slug to "our volunteers."
The current premium I'm using does not create a WordPress typical page for this so I can't modify the url of the page. So, this does not work -> https://www.competethemes.com/blog/change-page-url-wordpress/
Is there like a hook i can use? Permalinks only allow changing the url structure of the entire site.
What you exactly looking for is Page attributes
https://wordpress.com/support/pages/page-options/#parent-page
You have parent page Our volunteers
http://example.com/our-volunteers
And pages of children pages
http://example.com/our-volunteers/john-doe
http://example.com/our-volunteers/foo
http://example.com/our-volunteers/bar
Set our-volunteers as page slug when you create Our volunteers page
Assign pages John doe, foo, bar to Parent page (Our volunteers) from Page attributes section bottom right on 'creating new page' page
One hack could be to edit .htaccess for this particular issue. It's kinda hacky and might get you into other problems. There's also plugins to do rewrites for you.

Create a Custom URL in Wordpress

Is there a way one can create custom permalinks in Wordpress?
For instance I am trying to create the following url:
website.com/our-services/douchebag-removal
but when I create the page douchebag removal I can not add the / to the permalink so it can look like this our-services/douchebag-removal.
This is what I get:
website.com/our-servicesdouchebag-removal
Please share your thoughts!
This is a simple one that gets me every time, on the our-douchebag-removal page you need to chose the parent page "Our Services" in order for the url path to reflect that.
Another solution, easier to use and not needing you to create parent pages: https://wordpress.org/plugins/custom-permalinks/ It's basically a plugin that allows you to put any url on a wordpress page/post. Let me know if it helped!

Wordpress Custom Menu - how to dynamically link to current user's page

In the Wordpress Menus Custom Links, I want to create a page called "My Page", and when the Current User clicks this Custom Link, it takes him to his specific page.
E.g mydomain.com/%CURRENT USERNAME% /
mydomain.com/johnsmith
Reading other posts, it appears that the Wordpress Custom Link understands only a static URL, not a dynamic one.
Therefore I need some way for the system to "get" the current user info, and redirect accordingly.
I have viewed the replies at this previous thread and here but I am still lost.
My coding ability is even less than the first guy's (but I do try!), so I can understand the theory, but I don't understand the technical language.
Therefore, I understand "You need to place this code, in your Theme Functions/in the script of the page".
But I don't understand "You need to run a jQuery with this code"
What information can I enter in the Custom Link to achieve this?
What code do I need to enter in the back-end to read this information correctly?
Thank you very much.

Custom Fields, linking to a separate download page?

Afternoon all,
I have some Advanced Custom Fields set up, which allow the user to download files which are appropriate to a certain product.
For example, if the product was 'Product 1', the files would be 'Product 1 size' etc. This works perfectly, using the following:
Brochure
This adds the file which is added on each individual page, as in ACF I have set the location rules as shown in the screenshot
Now, the issue is as follows.
I need to create a whole new page, called downloads.
This page, will list all the products in my page, and then need to have the downloads available (the Custom Field File). Now, because this field is set up to show on the product pages, I am completely unsure as to how to show the downloads on a seperate page, because using
Brochure
is technically not telling me which product this is for.
I hope this makes sense.
EDIT:
I completely forgot to mention, this information will need to be inside a table, and I am currently using TablePress, a plugin.
So it would go like:
Prouduct --- Category --- Download
Thank you all!
After you have edited your question, my first answer does not make sense anymore. So here is what I suggest now:
A. This is the solution to what you actually asked
Install the Reveal IDs Plugin so you can see in the admin panel what post-IDs your products have
Look up the ID for a specific product
In your TablePress table-cell you paste the ACF-shortcode:
Download brochure
post_id="12": this is the ID of your product-post which you can look up with Reveal IDs.
I already tested this right now, so I do know it's working.
B. Another solution that is more a question
Your ACF field 'brochure' obviously contains a URL to a file which might be available in your WP media library too?!
When this is the case you don't need the ACF field for your table. You can just:
click "Advanced Editor" (when working with the table)click into a table cell
click into a table cell
click "Add files" and link to your file directly this way
Maybe that is an option too.
I think I understand what you're trying to do. This should point you in the right direction: http://www.advancedcustomfields.com/resources/query-posts-custom-fields/

How to remove the author and date of creation details from an article?

Am creating a sample website using Joomla. I am just a beginner. How to hide the author details and date of creation from an article published?
While creating the article on the right side panel you will see Parameters(Advanced) there all the parameters will be set to Use Global by default change the your requirements to Hide.
This also can be handled from the editing of the article.
Additionally, the author will be shown by default in a meta-tag - invisible to normal users, but visible to search engines and everybody with a bit of HTML knowledge.
To hide the author's name completely, go to Global Configuration > Show Author Meta Tag : No
(A not-yet-mentioned third place where you could hide the author name: Article Manager > Parameters. Actually, that's where I'd do it if I wanted to set it for all the articles: I could still activate it per article or menu item, but by default, it will fall through to Hide.)
It is simple go to Menu and select your desire menu when it loads. See Article Options and Hide all or choose No and do the same for articles as well.
Enjoy!
In addition to srinivas answer, depending on how you set your site up, you might find the parameters under the Menu Item you have setup for the section/category/article. For instance, if you have a menu item pointing to a category/blog, you'll see the params in there.

Categories