Altering WordPress Link Structure for Portfolio - php

Is it possible / easy to change the permalink format for portfolios?
I want to have a page called projects, and each “portfolio’ item as a project.
Site
So /projects
and each project is under that: /projects/example/
instead of /projects -> /portfolio/example/

It is possible, but I think that the author of the theme that named this custom post type as 'portfolio' can alter it in the code of the theme,, . It can be hacky to change it on your own because you may break things..
You can try to ask the developers of the theme that you bought to help you with that, I belive it is this theme
http://centum.purethe.me/
right?
Hope they can help you with that, and if not, I'm afraid if you do not post some specific code than community can't help you much either,,,
hth, k

You should check the files of the theme and look for the file where the portfolio posttype is added. You could add here the following code to rewrite the slug.
$rewrite = array(
'slug' => 'project',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
Most of the time the file where the posttypes are added are in the 'lib' folder or something like that.

Related

Wordpress redirects single post permalink to the front-page.php file

Having a strange wordpress custom theme issue that I can't crack.
I have a custom post type 'artists' that I am displaying posts for that include a link with the_permalink();
I expect this permalink to take me to the template that I have named single-artists.php -- but instead it takes me to front-page.php every time, even though the link in the browser is the correct permalink that should take me to the single post page.
I have refreshed my permalinks in settings several times, and I have loaded the page and flushed my cache/removed cookies. Still going to front-page.php, no matter what post I click on, even though the permalink does change each time.
Anything else I should be doing? AFAIK the naming convention for single-artists.php is correct as the post type IS artists.
Classic case of me being a beginner, I hadn't noticed that my posts had been hidden from public. Setting public to true (like below) fixed it. If there's any other newbies who run into this hopefully this helps you!
function create_artist_post() {
$args = array(
'labels' => array(
'name' => 'Artists',
'singular_name' => 'Artist'
),
'public' => true,
'show_ui' => true,
'menu-position' => 20
);
register_post_type('artists', $args);
}
add_action('init', 'create_artist_post');

How can I change my page name in Wordpress? Do I need to edit my URL .htaccess?

My first post so I hope someone can help :)
I need to change http://designoriginal-test.co.uk/ef-travel/portfolio to http://designoriginal-test.co.uk/ef-travel/exhibitions
How can I go about doing this? There is no 'physical' page in the Wordpress backend so I am not able to change the slug manually.
Thanks in advance!
Zak
Looking at your site's source code I see body has classes post-type-archive and post-type-archive-portfolio, so it's not a taxonomy archive but a post type archive.
<body class="archive post-type-archive post-type-archive-portfolio nictitate-builder nictitate-header-style-1">
So, portfolio is a Custom Post Type. This allows two possibilities:
You're using a plugin to handle CPT's (eg: Custom Post Types UI).
In this case, you should have a submenu in your WP Dashboard where you could rename the post type.
Your CPT's are defined in your custom theme's (or custom plugin) source code
In this case, you should locate there (check your functions.php) some piece of code like this:
register_post_type( 'portfolio', … );
where you'll be able to rename the portfolio too.
In both cases I recommend you to backup your Database first. And if you're editing some source code files, backup them too before making changes.
Update:
After some research on the theme I've seen there's a free version of it. This version requires (via TGM Plugin Activation) a custom plugin from the same developer named Kopa Nictitate Toolkit.
function kopa_register_required_plugins() {
$plugins = array(
array(
'name' => 'Kopa Nictitate Toolkit',
'slug' => 'kopa-nictitate-toolkit',
'source' => 'http://downloads.wordpress.org/plugin/kopa-nictitate-toolkit.zip',
In this plugin they register the portfolio's CPT. So, check if you have this kopa-nictitate-toolkit folder in your /wp-content/plugins/. If so, there's a file named portfolio.php where they register the Portfolio CPT.
Edit:
You'll see that besides registering the CPT
register_post_type('portfolio', $args);
they also register some custom taxonomies.
register_taxonomy('portfolio_project', 'portfolio', $taxonomy_category_args);
register_taxonomy('portfolio_tag', 'portfolio', $taxonomy_tag_args);
You'll need to change this too so the theme won't broke. Check register_taxonomy docs.
Hope this helps!
Just go to the page and change the page name and its Permalink

How to rewrite URL of Custom Taxonomy in Wordpress?

There are custom posts and taxonomy in my theme (Wordpress). I want to change url of them. At the moment I have sth like this:
www.mypage.pl/catalog/
I need rewrite url like this:
www.mypage.pl/parent/catalog/
I put the code:
'rewrite' => array(
'slug' => 'parent/catalog',
'with_front'=> false,
'feed'=> true,
'pages'=> true
),
This works for page www.mypage.pl/parent/catalog/myproduct, but www.mypage.pl/parent/catalog/ isn't.
Most likely, you just need to flush the permalinks to test your new one out.
After executing your custom post code, run flush_rewrite_rules(); to clear your code and implement your new permalink structure. (you only need to do this once, so remove the code after you've executed it)
http://codex.wordpress.org/Function_Reference/flush_rewrite_rules

Create new admin section in wordpress - for creating office-pages

Ok, I have been looking for hours and I have to say I am really lost. I am trying to create a new section in the admin section of wordpress that should enable the user to create a new custom "office" page.
There is really many office pages on the site I have been working on (over 30), each with its opening hours, map, and images. I assume the client will want to add more later (or remove them) and they would like to manage it through Wordpress. That would mean adding a section that would enable them to put in the name of the office, opening hours, images and the location and it would create a new office page. I am rather a front-end developer and I have never worked with Wordpress before. I understand the loop, etc, I have read several things about Themes and how to create them but I am seriously stuck with how to create a section in admin area that would enable page creation/deletion with certain options.
Any help is greatly appreciated, just please point me to the correct direction. Web pages, WP codex, tutorials, youtube... whatever that helps. Thanks a bunch!
You can make custom post type..
By writing Code in function.php
function function-name(){
register_post_type( 'post name',
array(
'labels' => array(
'name' => __( 'post name' ),
'singular_name' => __( 'post name' )
),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'post name'),
'supports' => array('title','editor','author','thumbnail','comments','custom-fields'),
)
);
}
add_action('init', 'function-name');
3 steps : -
1. create office post type by using Register Post Type
2. Create office categories by using Register taxonomy
3. create a meta box by using Add Meta Box for extra fields which wordpress doesnt offer by default like (office hours )
hope it helps !

Wordpress: Permalinks for custom post types with_front causing rediect loops

So after searching google and through SO, I've found that adding
'with_front' => false`
to the rewrite attribute of a new content type, making
'rewrite' => array('slug' => 'Venue','with_front' => false)
should remove the prepended directory (ex. blog/, that defaults to my other pages).
However, it's just causing a redirect loop..
My default prepended permalink is blog/ which is fine normally. However, I have a custom content type event that I don't wish to have blog/ prepend.
What's happening: url.com/blog/event/new-event-12/
What I want: url.com/event/new-event-12/
What's another/the best way to do this?
Thanks!!
Ok, so this works.
I didn't know you had to refresh the permalinks to have the new code take effect.
The easiest way to do this is to just go to the permalink settings page and click save.

Categories