Wordpress Widget Title change from H1 to H3 or H4
I have done a crawl on my website using screaming frog and found out that each page has at least 6 H1's
I was hoping someone could tell me a way to change this from H1 to a lesser H, maybe H3.
I tried inserting into funchtions.php:
add_action( 'after_setup_theme', 'remove_parent_theme_features', 10 );
function remove_parent_theme_features() {
remove_action( 'init', 'sempress_widgets_init' );
add_action( 'init', 'ph_sempress_widgets_init' );
}
function ph_sempress_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar 1', 'sempress' ),
'id' => 'sidebar-1',
'before_widget' => '< section id="%1$s" class="widget %2$s">',
'after_widget' => '< /section>',
'before_title' => '< h3 class="widget-title">',
'after_title' => '< /h3>',
) );
}
It has an effect but rather than changing the title to H3, it shows the lines of code
i.e:
< /section>< section id="woocommerce_layered_nav-3" class="widget woocommerce widget_layered_nav woocommerce-widget-layered-nav">< h3 class="widget-title">Favourite Brand?< /h3>
rather that just showing Favourite brand.
Can anyone see any way I can tweak the above so it works properly?
1 answer
-
answered 2018-01-11 21:31
Paul Shipley
Have you tried removing the extra spaces on the html tags?
register_sidebar( array( 'name' => __( 'Sidebar 1', 'sempress' ), 'id' => 'sidebar-1', 'before_widget' => '<section id="%1$s" class="widget %2$s">', 'after_widget' => '</section>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) );
https://github.com/pfefferle/SemPress/blob/master/sempress/functions.php
See also questions close to this topic
-
Getting PHP/MySQL app working on cPanel
I uploaded my web files as usual to the cPanel file manager, and also imported my database to the cPanel mysql, and connected with the username, dbname and password as it was given i.e user_username, user_dbname, password, using php.
Everything works well on my localhost, via xampp, but on the internet, no information is taken to database, or received or even verified, and also the admin can not login, even if they inserted the correct credentials that are in the db.
-
Having an issue passing a variable from a while mysqli_fetch_array loop to another page so I can use it with $_GET on the other side
Hello I am trying to use $_GET to pass a variable over to the contact.php page mentioned, but the outcome is:
/contact.php?firstname=
this is the link that im clicking to send the variable:
echo '<a href="contact.php?name="' . $email . '">';
This is the code to get the variable on the other side:
<?php $name = $_GET['name']; echo $name ; ?>
-
Force error in mysqli prepared statement for testing
I'm adding error-checking of prepared statements to an existing website so that users will be able to report back on any database errors that they encounter. Each statement will be given an unique error code so that it will be easy to trace exactly where the error occurred. However, I've been unable to force any errors so can't test whether the code is working. For example, in the (simplified) code below, I've tried putting in the wrong database ID, wrong tables, etc. but I always get a 'success' result.ure
function login($a){ $loginQuery = mysqli_prepare('db', "SELECT * FROM Users WHERE UserID = ?"); mysqli_stmt_bind_param($loginQuery, 's', $a); if(mysqli_stmt_execute($loginQuery)){ echo 'success'; } else { echo 'fail'; } login('abc123');
I'm assuming the 'if' statement is on the wrong command but don't know why, or where it should go instead.
-
how to change " Designed & Developed By KAINELABS.COM" from Youzer - Buddypress Community Wordpress Plugin
i want to remove "Designed & Developed By KAINELABS.COM" from Youzer - Buddy-press Community WordPress Plugin , actually this message is showing user account profile settings . please help me !
-
Css modified after wordpress update
i have updated my WordPress version. The style of the css is modified. I have a backup version. Should I take the oldest file for plugins and theme in order to resolve that issue?
-
Change date format into Appointment form
Hi stack i have one issue with showing date in wanted format DD/MM/YYYY instead of MM/DD/YYYY as is now. In date selector: "Datum Voor Afspraak" on my page after selecting date is shown in wrong format. This is code from that part:
<div class="sec-title"><h3 class="skew-lines"><?php esc_html_e('datum voor afspraak', 'carshire');?></h3></div> <div class="row"> <div class="col-md-6"> <div class="sec-title"><h3><?php esc_html_e('Datum voor afspraak', 'carshire');?></h3></div> <input type="text" name="apt_date" id="apt_date" class="date- picker" placeholder="<?php esc_html_e('DD/MM/YYYY', 'carshire');?>"> </div> <div class="col-md-6"> <div class="sec-title"><h3><?php esc_html_e('tijdsblok', carshire');?></h3></div> <select name="apt_timeframe" id="apt_timeframe" class="select- input"> <option value="" selected="selected"><?php esc_html_e('Choose...', 'carshire');?></option> <?php $time_frames = explode("\n",$time_frames_str);?> <?php foreach($time_frames as $time_frame):?> <option value="<?php echo esc_attr(str_replace("<br />","",$time_frame));?>"><?php echo balanceTags(str_replace("<br />","",$time_frame));?></option> <?php endforeach;?> </select> </div> </div>
Can someone to help me to resolve this?
-
Remove duplicate items from Woocommerce
I had problem during importing products. And now some of the products are duplicated. All of the duplicated products have the same title and attribute (collection_id). Also there are a lot of duplicated media files. Is there a way to remove duplicated products? At least i want to remove products.
-
Add metre or piece depending on product tag in woo-commerce
So I am making a fabric website and on the product page, I want to display two different things for fabrics sold in meters and fabrics sold in pieces.
For meters:
'/per meter' after the price,
'X meter(s) in stock' instead of just saying 'X in stock',
And the word 'meter(s)' next to the quantity box.For pieces:
'/per piece' after the price,
'X piece(s) in stock' instead of just saying 'X in stock',
And the word 'piece(s)' next to the quantity box.I was hoping to be able to do this by using the existing tags 'Sold by the Meter' and 'Sold by the Piece', to prompt the displaying of these different bits of text.
I currently have a custom field in the product with a code snippet that does the '/per meter'./* If product have a custom field my_custom_unit */add_filter('woocommerce_get_price_html','wdm_add_unit_for_price'); function wdm_add_unit_for_price($price){` global $post; $my_unit=get_post_meta( $post->ID,'wdm_my_custom_unit', true ); if($my_unit){ $price=$price.'/'.$my_unit; } return $price;}
Any ideas how I can proceed?
Any help is appreciated.
-
Woocommerce Product Category and Subcategory dropdown select
I am setting up a wordpress site with woocommerce. i have my products arranged in categories and subcategories eg. car brand > car > year of manufacturing > products
i wanted to have a simple form at home page to select category and each subcategories that eventually leads users to the product. when i choose car brand, the car dropdown only shows selection of cars of that brand; and after i choose car, the year dropdown only shows the available selection of that car.
I tried to look for plugin, but i cannot find any suitable one. how should i do this?
-
onReceive isnt getting called on ListView widget clicked
I am trying to implement widgets in my android app, I have successfully rendered my widget on home screen, now I have a listview widget and I want to open an activity on click of any listview item but onResponse method isn't getting called on item click. It is only getting called on widget creation and deletion.
Heres my AppWidgetProvider
public class CollectionWidget extends AppWidgetProvider { List<String> mCollection = new ArrayList<>(); public static final String TOAST_ACTION = "com.example.android.listview.TOAST_ACTION"; public static final String EXTRA_ITEM = "com.example.android.listview.EXTRA_ITEM"; static void updateAppWidget(Context context, AppWidgetManager appWidgetManager, int appWidgetId) { RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.collection_widget_large); views.setTextViewText(R.id.appwidget_text, widgetText); setRemoteAdapter(context, views); appWidgetManager.updateAppWidget(appWidgetId, views); } @Override public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { final int N = appWidgetIds.length; initi(context); for (int appWidgetId : appWidgetIds) { Intent intent = new Intent(context, WidgetService.class); intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME))); RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.collection_widget_large); for(int i=0;i<mCollection.size();i++) rv.setTextViewText(android.R.id.text1, mCollection.get(i)); rv.setRemoteAdapter(appWidgetId, intent); Intent toastIntent = new Intent(context, CollectionWidget.class); toastIntent.setAction(CollectionWidget.TOAST_ACTION); toastIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId); intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME))); PendingIntent toastPendingIntent = PendingIntent.getBroadcast(context, 0, toastIntent, PendingIntent.FLAG_UPDATE_CURRENT); rv.setPendingIntentTemplate(R.id.widget_list, toastPendingIntent); updateAppWidget(context,appWidgetManager,appWidgetId); } super.onUpdate(context, appWidgetManager, appWidgetIds); } private void initi(Context context) { ArticleTable articleTable = new ArticleTable(context); articleTable.open(); Cursor articleListCursor = articleTable.getAllArticles(); int j = 0; if (articleListCursor != null && articleListCursor.moveToFirst()) { do { j++; mCollection.add(articleTable.articleObject(context, articleListCursor).getTitle()); } while (articleListCursor.moveToNext() && j < 3); } if (articleListCursor != null) articleListCursor.close(); articleTable.close(); } @Override public void onReceive(Context context, Intent intent) { Toast.makeText(context, "Touched", Toast.LENGTH_SHORT).show(); AppWidgetManager mgr = AppWidgetManager.getInstance(context); if (intent.getAction().equals("row")) { int appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID); int viewIndex = intent.getIntExtra("row", 0); Toast.makeText(context, "Touched view " + viewIndex, Toast.LENGTH_SHORT).show(); } super.onReceive(context, intent); }
}
here's my manifest
<receiver android:name=".ui.widget.CollectionWidget" android:label="Large"> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> <action android:name="com.example.android.listview.TOAST_ACTION"/> </intent-filter> <meta-data android:name="android.appwidget.provider" android:resource="@xml/collection_widget_info_large" /> </receiver> <service android:name=".ui.widget.WidgetService" android:permission="android.permission.BIND_REMOTEVIEWS" />
-
Odoo 10 gauge widget overloads
Odoo gauge widget "overloads" in Odoo 10. This was not the behavior in Odoo 8. That is, The progress of the gauge never went pass the limit set in
max_field
.Picture v10:
Picture v8:
Sample code:
<field name="lead_total" widget="gauge" style="width:160px;height:120px;cursor:pointer" options="{'max_field':'lead_objective'}"> Lead </field>
lead_total
andlead_objective
are just regular float fields. I've also tried with integers: same result.Thanks in advance.
-
How to create a dynamic TabBarView/ Render a new Tab with a function in Flutter?
So I have been learning flutter in a while and I am stuck in this. Sorry if it is a noobish question. I am currently trying to build something like a Card Tab. The information and widget will be stored in a card.
Imagine something like Tinder, where they have multiple card stack and swipe left and right to navigate.
I plan to create that but I cannot seems to find a way to add/render a new card with a button.
It's like adding something to the list, Flutter will use a ListView builder where we add to the list. But there is no TabBarView builder. Is this something that is not possible to do? I try putting a list inside a tab but it's still wont be the same.
I created some basic skeleton here to help convey my meaning. So the card will be swipe left and right and there is a button in the appBar to add card. Lenght is 2 now and I wanted the button to render the 3rd card. Is this possible?
Thanks in advance!
import 'package:flutter/material.dart'; void main() { runApp(new MaterialApp( home: new CardStack(), )); } class CardStack extends StatefulWidget { @override _MainState createState() => new _MainState(); } class _MainState extends State<CardStack> with SingleTickerProviderStateMixin { TabController _cardController; @override void initState() { super.initState(); _cardController = new TabController(vsync: this, length: 2); } @override void dispose() { _cardController.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return new Scaffold( backgroundColor: Colors.grey[300], appBar: new AppBar( actions: <Widget>[ new IconButton( icon: const Icon(Icons.add), tooltip: 'Add Tabs', onPressed: null, ), ], title: new Text("Title Here"), bottom: new PreferredSize( preferredSize: const Size.fromHeight(20.0), child: new Theme( data: Theme.of(context).copyWith(accentColor: Colors.grey), child: new Container( height: 50.0, alignment: Alignment.center, child: new TabPageSelector(controller: _cardController), ), ) ) ), body: new TabBarView( controller: _cardController, children: <Widget>[ new Center( child: new Card( child: new Container( height: 450.0, width: 300.0, child: new IconButton( icon: new Icon(Icons.favorite, size: 100.0), tooltip: 'Favorited', onPressed: null, ) ), ), ), new Center( child: new Card( child: new Container( height: 450.0, width: 300.0, child: new IconButton( icon: new Icon(Icons.local_pizza, size: 50.0,), tooltip: 'Pizza', onPressed: null, ) ), ), ), ], ), ); } }