Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
Hi,
Very happy with the themes only I like to delete the first part of the category title, ” Category Archives” and just have the title /name of the category as the title.
I could do this in a Child Theme, i functions.php but I do not want to add a Child Theme is this case. So is there a way to do this in the Custom CSS via WP admin.
I have the Premium version installed.
Thanks
Hi Mariken
Thanks for running Vantage.
The child theme solution is unfortunately the best fix for this at the moment. The Category Archives: part of the heading tag isn’t wrapped so I don’t see a way to remove that and not the entire title.
Hi Andrew,
Is there not a way to change it in the ‘archive.php’ file?
I checked and searched for the word “Category Archives” and did not find it. There must be a way….
Unfortunately any changes you make to theme files will be overwritten when you next update the theme. Doing this with a child theme is relatively straightforward. Besides a style.css file in your child theme as follows:
/* Theme Name: Vantage Child Author: SiteOrgin Template: vantage Version: 1.0.0 */ @import url("../vantage/style.css");You need a functions.php file as follows:
<?php if( !function_exists( 'vantage_get_archive_title' ) ) : /** * Return the archive title depending on which page is being displayed. * * @since vantage 1.0 */ function vantage_get_archive_title(){ $title = ''; if ( is_category() ) { $title = sprintf( __( 'My Category Archives: %s', 'vantage' ), '<span>' . single_cat_title( '', false ) . '</span>' ); } elseif ( is_tag() ) { $title = sprintf( __( 'Tag Archives: %s', 'vantage' ), '<span>' . single_tag_title( '', false ) . '</span>' ); } elseif ( is_author() ) { the_post(); $title = sprintf( __( 'Author Archives: %s', 'vantage' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); rewind_posts(); } elseif ( is_day() ) { $title = sprintf( __( 'Daily Archives: %s', 'vantage' ), '<span>' . get_the_date() . '</span>' ); } elseif ( is_month() ) { $title = sprintf( __( 'Monthly Archives: %s', 'vantage' ), '<span>' . get_the_date( 'F Y' ) . '</span>' ); } elseif ( is_year() ) { $title = sprintf( __( 'Yearly Archives: %s', 'vantage' ), '<span>' . get_the_date( 'Y' ) . '</span>' ); } else { $title = __( 'Archives', 'vantage' ); } return apply_filters('vantage_archive_title', $title); } endif;Within the functions.php file you can edit any of those titles.
Here is the child theme, all ready to go: https://siteorigin.com/wp-content/uploads/2014/09/vantage-child-archives-title.zip. Just install via Appearance > Themes > Add New: Upload Theme, then edit functions.php via Appearance > Editor.
(Once done you’ll need to redo your Appearance > Customize settings)
Is it also possible to add the css in the Custom Css? Or do I still have to create a php?
Hi gerkof
The first code snippet is CSS but the second is PHP, that needs to go in a child theme functions.php file.
For further help please open a new support thread:
https://siteorigin.com/new-thread/
Thanks
Thanks guys,
I ‘ll save this for next project.
For sure. Just remember that when you install this or any child theme you’ll need to redo Appearance > Customize and Appearance > Menu settings.
All the best.
Hi Andrew,
Yes, that’s exactly the reason why I did not wanted to do, redo all the settings in this case.
A speedy ‘hack’ might be the WPimport plugin. :)
For sure. Thanks for your feedback.
To get rid of “Category Archives:” you can change line 18 in archive.php file
from:
to:
It will then display category name only without “Category Archives:” part…
However as Andy mentioned this change gets overwritten with (any) theme updates, as theme updates overwrite theme’s files including archives.php
Applying a child theme is better choice, and if you are familiar with PHP My Admin there is a quick way to copy Personalisation/Customisations from within mysql database. After you switch to child theme in mysql database, in “wp_options” table, locate the “theme_mods_vantage” row in option_name column, from there select & copy the value. Then locate the row with “option_mods_vantage-child” (where vantage-child is the name of your child theme (e.g. if your child theme folder name is vantage- then it would be exactly like above, if your child theme folder name is different, say my-child-theme you would be looking for row “option_mods_my-child-theme”. After you locate it paste the earlier copied value to the option value field.
Now relax and have a beer – theme options/personalisations/customisations are there!
Hi Sławomir
Thanks for the info here, much appreciated!