On two of my wordpress sites the page/post title is not automatically assigned the H1 tag.
I'm assume, I need to change the CSS templates for this.
Does anyone know, where to change the theme or CSS, so that the page/post title automatically becomes the H1 tag as well?
Thank you
You should change your php files in the theme folder (\wp-content\themes) to modify an H1 since the css only gives styles to it.
Try it
<?php the_title( '<h1>', '</h1>' ); ?>
Related
I have a website and need to add top bar header for some text, date and time.
Are there any plugins to do this or how I custom my header for this?
I assume you are not using your own custom theme. I would start out by creating a child theme which is the recommended way of modifying an existing premium theme. This will allow you to modify the header.php file so when the parent theme is updated, your changes will not be overwritten.
https://codex.wordpress.org/Child_Themes
After you create your new child theme with the style.css and functions.php files, you'll need to copy over header.php from parent to child. Not sure what the header.php file looks like but if you add in something similar to the code below, it should work:
<ul>
<li>Here is some text</li>
<li>Today is <?php echo date_i18n( "F j, Y, g:i a" ); ?></li>
</ul>
Not sure if styling (CSS) is possible w/ this php code, but if anyone knows how i can style this ( with colors, etc) please let me know! this is the basic WooCommerce drop-down code that's placed in my template files
<?php the_widget( 'WC_Widget_Product_Categories', 'dropdown=1' ); ?>
Using Plugin :
https://wordpress.org/plugins/widget-css-classes/
Please note that this plugin doesn't enable you to enter custom CSS. You'll need to edit your theme's style.css or add another plugin that allows you to input custom CSS.
Refer this for full article
http://www.wpbeginner.com/wp-themes/how-to-add-custom-styles-to-wordpress-widgets/
In my current WordPress theme, i have some 5 widgets.
I tried with plugins available on internet but that not solved my problem.
I want to use more widgets in my theme in single sidebar.
How can i add more widgets in WP theme?
Thanks
Most widgets give you a shortcode to put into one of the pages that wil be echoed out through the the_content(); function.
So if you would like to process those shortcodes in the PHP to make them in custom places would probably be your best bet.
You can do that like this:
<?php echo do_shortcode( $content ) ?>
Here is the reference
I created an own template for WordPress 3.4.1 and got the problem that WordPress automatically(???) generates titles for every single page I create, but I don't want the page-titles as headline.
My template bases on the "Modern Theme" for Magento eCommerce. After adapting for WordPress it consists of footer, header and index.php and a style.css without attributes for page-titles. - Kind regards.
Remove the <?php get_title() ?> from the page.php and single.php.
Since it is a display issue, you should add display:none; to the corresponding css class or id, no need to remove the_title or get_title.
The TinyMCE editor in WordPress 3 is removing my div tags if I switch from HTML view to visual and update my page. What would be the best way to prevent this from happening?
I have a styled horizontal rule that I enter into the pages/posts by putting the following code:
<div class="hr"></div>
You could also create a shortcode by entering the following in your themes functions.php file:
function hr_shortcode( $atts, $content = null ) {
return '<div class="hr"></div>';
}
add_shortcode( 'hr', 'hr_shortcode' );
Then you would just need to add [hr] into your post.
Have you tried converting them to entities?
>div class="hr"<>/div<
Wordpress strips certain tags out automatically. Try this plugin that allows you to specify which tags you don't want stripped.
http://wordpress.org/extend/plugins/tinymce-valid-elements/
You can also manually hack the tiny MCE config files, but I think sticking with the plugin is the easiest and safest bet.