Forum Replies Created
-
AuthorPosts
-
andym119
MemberHi Davinder, thanks for the reply.
Yes I have tried that as well as things like:
$defaults = array( 'default-color' => '000000', 'default-image' => '', 'default-repeat' => '', 'default-position-x' => '', 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '' ); add_theme_support( 'custom-background', $defaults );
$args = array( 'default-color' => '000000', 'default-image' => get_template_directory_uri() . '/images/background.jpg', ); add_theme_support( 'custom-background', $args );
But that only sets the background ready in appearance > background, users have to click save for it to take affect on the front end.
This works on the front end by default, by using css in the functions.php but again, users can't overwrite it in appearance > background:
add_custom_background('set_theme_background'); function set_theme_background() { echo "<style type='text/css'>"; echo "body { background-color: #000000;}"; echo "</style>"; }
Is there a way of putting a conditional to the above code so it applies the above only if there is no background set in appearance > background.
Thanks in advance
andym119
Member*I meant to type the word layout instead of widget
andym119
Membertry Installing a plugin called Simple Custom CSS
Once installed go to appearance > custom css
In the editor type the following:#home-middle .featured-content img { float: left; }
and save.
To put a margin between them aswel, also type:
#home-middle .featured-content img { margin-right: 5px; }
andym119
MemberSometimes it shows straight away if you type the direct url path to your favicon, example:
mywebsite.com/wp-config/themes/my-theme/images/favicon.ico
you can also try removing the cache of your browser and reboot the browser.
andym119
MemberThere may be a plugin for it, I'm not sure, alternatively you can use css.
If your using chrome or firefox, right click on the post or page you want to add the background on and click inspect element.
In the html field look for the post or page name it will look something like this depending what post/page it is:
class="post-1"
or
class="page-15"you can use these classes to add a background by putting it in a css editor or your child theme css.
for example to change the background for post 6, put in your css -
.post-6 {
background: red;
}You can also add an image by using css background image and putting the url to an image in your media library.
or you could use pseudo class 'nth-child' in your css, such as:
.post:nth-child(8n+8) {
background: blue;
}which says for every 8th post, add this background. You can then add more of these.
andym119
Membercheck out this plugin also http://wordpress.org/plugins/admin-bar-login/screenshots/
andym119
MemberIf you are setting up a new multisite from the latest wordpress version, you don't need a blog.dir, blog.dir was for older wordpress versions. When you set up a multisite from the latest wp version it will automatically create an 'upload' directory that will contain all uploads and media.
check out: http://codex.wordpress.org/Multisite_Network_Administration under Uploaded File Path
New sites are set can be setup by Super admin: dashboard - sites - new.
Users can create sites: dashboard - my sites - create new site. (you can control this in network settings)
People that visit your site can create a site by linking them to your registration page:
your-website.com/wp-signup.phpandym119
Memberandym119
MemberI just got it to work.
I can use the display:none for one of the headers without both headers going. I just had to add
'after' => '</div>',
in both the header functions.
Most websites don't suggest including
'after' => '</div>',
for tutorials in creating a widget area, however studiopress tutorials includes it, I don't know what it actually does but it works perfect now.andym119
MemberDon't worry, I think I misread
andym119
MemberYou don't need to set up wildcard subdomains if you are using subdirectory structure.
Once you set wp-config.php multisite to true -
If your wordpress core files were in your root; brentwoodyouthsoccer.net
You will have 2 options to set up multisite - sub domains or sub directories:
subdomain is subdomain.yourwebsite.com
subdirectory is; yourwebsite.com/directoryBut because your wordpress core files are in a directory; brentwoodyouthsoccer.net/directory
You only have 1 option to set up multisite and that is the sub-directory structureSo you don't need to setup wildcard subdomain.
If your wordpress files were in your root and you decided to set up the sub-domain structure, then you will need to setup wildcard subdomain and you should check requirements of your host to allow this feature.
andym119
MemberI've seen on the forums you can add conditionals to widget areas, such as:
if ( ! is_home() ) return;
Is it possible to do something like this instead, that has conditionals for screen sizes, rather than use css to make the widget areas appear and disappear.
Just to update, both widget areas work completely fine but I would like 1 to display above 782px screen size width and then 1 to display below 782px screen size width.
andym119
MemberI have just worked out a solution to do this. It also allows users to select the height of the header, link the header image back to my homepage and allows the image to respond in ratio as the screen gets smaller which saves me asking other questions on the forum 🙂
I'll keep this as a reference if anyone wants to do the same.
I removed the header theme support and registered a new widget area and hooked it in genesis_header. I then installed a plugin called image widget, moved the image widget in the new widget area and I can now have any height show automatically (the whole image will show so the height depends on the width and width-height ratio) and add a link for it. This header image is also now an img tag in the html and so responds bit by bit in ratio as the screen gets smaller like the other images do which I much prefer.
The site title and description now appears above the header image but you can reposition or remove with css.
The header is now perfect for my site, does anyone see any issues with this setup ?
February 19, 2014 at 2:48 am in reply to: In Beautiful Pro – Make site header background image linkable #91098andym119
MemberI don't think there is an easy solution to do this, I have been told before it is not possible. However I have managed to work out a way of doing it but I have created my own child theme on the genesis framework so I am not 100% sure the best way to make php and css edits in genesis own child themes such as beautiful pro, you'll have to ask in the forum.
I managed to link the header by creating a new widget area then uploading an image and linking it by an excellent image widget plugin. The extra benefit of doing this is the image becomes an img tag in the html and so it will respond to the screen size/mobile like your current images do in your post.
First download the image plugin, it is called 'Image Widget' it's a popular and highly rated plugin. You can test how it works by moving the widget in one of your sidebar widget areas, selecting an image then typing the link. the image is now linked and the image also responds in ratio as the screen gets smaller. Basically you want to do this, but instead, you want to move the widget to a new widget area so the image will appear in the same place as your current header.
You'll need to ask how to create a new functions.php for your theme as I'm not sure how.
To Register a new widget area type in your custom functions.php:
genesis_register_sidebar( array( 'id' => 'header_banner_widget', 'name' => __( 'Header Banner', 'custom' ), 'description' => __( 'This is the widget area for the Header Banner', 'custom' ), ) );
To position the widget area type in your custom functions.php:
add_action( 'genesis_after_header', 'custom_header_banner' ); function custom_header_banner() { genesis_widget_area( 'header_banner_widget', array( 'before' => '<div class="header-banner widget-area">', ) ); }
(you can change the hook genesis_after_header if I have the wrong hook for your theme, look up http://genesistutorials.com/visual-hook-guide/ )
You can now move that image widget to the new widget area you created called Header Banner, upload an image, select size, and link it .
You may also need to remove the old header banner height by typing in a custom css file or css editer:.site-header-banner { display: none; }
Seems a lot of work just to link the header but this setup works perfect for my child theme and the responsiveness is improved.
andym119
MemberGood point, I'll use min-height. I'm still trying to figure it out but starting to think it can't be done as I would like. I saw a similar question on another forum but doesn't seem there is a solution for it. Nevertheless, I'll keep this topic unresolved for while.
andym119
MemberI'm developing my website locally.
If I create a genesis child theme and make no edits to it except the basics, I just go to admin/appearance/header to upload and insert the header image. The difference that I noticed between twentyfourteen and Genesis is when you right click and inspect element in the wordpress twentyfourteen theme, the header image is in the html as an image, so I can see why the height shows as it is.But by inspecting the header image on Genesis, the image is not sitting inside the <header class=”site-header,
it appears in the right styles tab - (index):19 and says:.custom-header .site-header { background: url(my-web-url-for-header-image) no-repeat !important; }
So I am not sure if there is any alternative solutions to get the Genesis header to work the same as the twentyfourteen theme where the height of the header will be displayed as the height it was inserted as. Otherwise I will need to install a custom css plugin and ask users to change the site-header height in the css to reflect the header image they inserted.
February 7, 2014 at 12:20 pm in reply to: Genesis appearance-header to work same way as non genesis themes #89163andym119
MemberFound the answer, just needed to do some changes to genesis-custom-header and make some changes to the following:
// Add support for custom header
$defaults = array(
'default-image' => '',
'random-default' => false,
'width' => 980,
'height' => 0,
'flex-height' => true,
'flex-width' => false,
'default-text-color' => '',
'header-text' => true,
'uploads' => true,
'wp-head-callback' => '',
'admin-head-callback' => '',
'admin-preview-callback' => '',
);
add_theme_support( 'custom-header', $defaults );andym119
MemberThanks for this this is just what I've been looking for. I'm still learning php so I don't always no what to do for the best and I've been building my php codes from genesis snippets and snippets from some other websites. With this setup, now everything works I can now register widgets, hook them, remove genesis admin items and I now don't have to have a functions.php in each child theme.
andym119
MemberI just done few tests and your right. I was advised on the wordpress forums to move all my child theme functions to an mu-plugin because I am creating my own child themes that I will be continually making. I would prefer for all my child themes to only contain a styles.css and an images directory as all my child themes will share the exact same functions, so I wanted a single place where I could put all function code that all child themes will share, that way everything is easy to manage, make changes and add functions in the future.
Is there a way of adding the start engine code to my file in the mu-plugins and be able to use all genesis functionality in it so I don't have to have a functions.php in all child themes.
Currently I have this code in a file in the mu-plugins directory:
//* Add HTML5 markup structure
add_theme_support( 'html5' );// Child theme (do not remove)
define( 'CHILD_THEME_NAME', 'Genesis Sample Theme' );
define( 'CHILD_THEME_URL', 'http://www.studiopress.com/' );// Add Viewport meta tag for mobile browsers
add_action( 'genesis_meta', 'sample_viewport_meta_tag' );
function sample_viewport_meta_tag() {
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
}// Custom background
add_theme_support( 'custom-background' );// Customize footer
remove_action( 'genesis_footer', 'genesis_do_footer' );
add_action( 'genesis_footer', 'sp_custom_footer' );
function sp_custom_footer() {
?>
<p>test</p>
<?php
}// Modify the size of the Gravatar in comments
add_filter( 'genesis_comment_list_args', 'sp_comments_gravatar' );
function sp_comments_gravatar( $args ) {
$args['avatar_size'] = 50;
return $args;
}// comments: Reposition Genesis Comment Form -reply above commments
add_action( 'genesis_before_comments' , 'wps_post_type_check' );
function wps_post_type_check () {
if ( is_single() ) {
if ( have_comments() ) {
remove_action( 'genesis_comment_form', 'genesis_do_comment_form' );
add_action( 'genesis_list_comments', 'genesis_do_comment_form' , 5 );
}
}
}//* Modify comments title text in comments
add_filter( 'genesis_title_comments', 'sp_genesis_title_comments' );
function sp_genesis_title_comments() {
$title = '';
return $title;
}//* Modify the leave a reply (speak your mind) title in comments
add_filter( 'comment_form_defaults', 'sp_comment_form_defaults' );
function sp_comment_form_defaults( $defaults ) {
$defaults['title_reply'] = __( 'All Comments' );
return $defaults;
}//comments - descending order by default
if (!function_exists('iweb_reverse_comments')) {
function iweb_reverse_comments($comments) {
return array_reverse($comments);
}
}
add_filter ('comments_array', 'iweb_reverse_comments');//* Customize the submit button text in comments
add_filter( 'comment_form_defaults', 'sp_comment_submit_button' );
function sp_comment_submit_button( $defaults ) {$defaults['label_submit'] = __( 'Post', 'custom' );
return $defaults;
}//* Remove comment form allowed tags
add_filter( 'comment_form_defaults', 'sp_remove_comment_form_allowed_tags' );
function sp_remove_comment_form_allowed_tags( $defaults ) {$defaults['comment_notes_after'] = '';
return $defaults;
}// Customize the entry header (requires HTML5 theme support)
add_filter( 'genesis_post_info', 'post_info_filter' );
function post_info_filter($post_info) {
$post_info = '[post_date] [post_comments] [post_categories before="Category: "]';
return $post_info;
}//* Customize the post meta function
add_filter( 'genesis_post_meta', 'sp_post_meta_filter' );
function sp_post_meta_filter($post_meta) {
if ( !is_page() ) {
$post_meta = '[post_categories before="Category: "] [post_comments] [post_tags before="Tagged: "] [post_edit]';
return $post_meta;
}}I have no functions.php in any child theme and just have a styles.css in each child theme. Everything seems to work correctly with this setup. However I plan to register a few widget areas, add hooks and remove a couple of genesis admin items. I have just tested these individually and they will not work in the file in mu-plugin but will only work if I have a functions.php in each child theme with the start the engine code at the top.
Would anyone be able to advise me on the best way to achieve the things I am trying to do.
January 14, 2014 at 7:47 pm in reply to: Should you not edit parent theme under any circumstance #85250andym119
MemberNo need to reply to this unless its for references I have found another solution
-
AuthorPosts