Allego Screenshot—- https://prnt.sc/staafz
Is it possible to create multiple sidebars?
Good evening. I thank you for your prompt reply.
This instead is the code of td_blok_3:
<?php
// v3 – for wp_010
class td_block_3 extends td_block {
static function cssMedia( $res_ctx ) {
// fonts
$res_ctx->load_font_settings( ‘f_header’ );
$res_ctx->load_font_settings( ‘f_ajax’ );
$res_ctx->load_font_settings( ‘f_more’ );
// module 1 fonts
$res_ctx->load_font_settings( ‘m1f_title’ );
$res_ctx->load_font_settings( ‘m1f_cat’ );
$res_ctx->load_font_settings( ‘m1f_meta’ );
}
public function get_custom_css() {
// $unique_block_class – the unique class that is on the block. use this to target the specific instance via css
$unique_block_class = $this->block_uid;
$compiled_css = ”;
$raw_css =
“<style>
/* @f_header */
.$unique_block_class .td-block-title a,
.$unique_block_class .td-block-title span {
@f_header
}
/* @f_ajax */
.$unique_block_class .td-subcat-list a,
.$unique_block_class .td-subcat-dropdown span,
.$unique_block_class .td-subcat-dropdown a {
@f_ajax
}
/* @f_more */
.$unique_block_class .td-load-more-wrap a {
@f_more
}
/* @m1f_title */
.$unique_block_class .td_module_1 .entry-title {
@m1f_title
}
/* @m1f_cat */
.$unique_block_class .td_module_1 .td-post-category {
@m1f_cat
}
/* @m1f_meta */
.$unique_block_class .td_module_1 .td-module-meta-info,
.$unique_block_class .td_module_1 .td-module-comments a {
@m1f_meta
}
</style>”;
$td_css_res_compiler = new td_css_res_compiler( $raw_css );
$td_css_res_compiler->load_settings( __CLASS__ . ‘::cssMedia’, $this->get_all_atts() );
$compiled_css .= $td_css_res_compiler->compile_css();
return $compiled_css;
}
function render($atts, $content = null) {
parent::render($atts); // sets the live atts, $this->atts, $this->block_uid, $this->td_query (it runs the query)
if (empty($td_column_number)) {
$td_column_number = td_global::vc_get_column_number(); // get the column width of the block from the page builder API
}
$buffy = ”; //output buffer
$buffy .= ‘<div class=”‘ . $this->get_block_classes() . ‘ td-column-‘ . $td_column_number . ‘ td_block_padding” ‘ . $this->get_block_html_atts() . ‘>’;
//get the block js
$buffy .= $this->get_block_css();
//get the js for this block
$buffy .= $this->get_block_js();
// block title wrap
$buffy .= ‘<div class=”td-block-title-wrap”>’;
$buffy .= $this->get_block_title(); //get the block title
$buffy .= $this->get_pull_down_filter(); //get the sub category filter for this block
$buffy .= ‘</div>’;
$buffy .= ‘<div id=’ . $this->block_uid . ‘ class=”td_block_inner”>’;
$buffy .= $this->inner($this->td_query->posts); //inner content of the block
$buffy .= ‘</div>’;
//get the ajax pagination for this block
$buffy .= $this->get_block_pagination();
$buffy .= ‘</div> <!– ./block –>’;
return $buffy;
}
function inner($posts, $td_column_number = ”) {
$buffy = ”;
$td_block_layout = new td_block_layout();
if (empty($td_column_number)) {
$td_column_number = td_global::vc_get_column_number(); // get the column width of the block from the page builder API
}
$td_post_count = 0; // the number of posts rendered
$td_current_column = 1; //the current columng
if (!empty($posts)) {
foreach ($posts as $post) {
$td_module_1 = new td_module_1($post, $this->get_all_atts());
switch ($td_column_number) {
case ‘1’: //one column layout
$buffy .= $td_block_layout->open12(); //added in 010 theme – span 12 doesn’t use rows
$buffy .= $td_module_1->render($post);
$buffy .= $td_block_layout->close12();
break;
case ‘2’: //two column layout
$buffy .= $td_block_layout->open_row();
$buffy .= $td_block_layout->open6();
$buffy .= $td_module_1->render($post);
$buffy .= $td_block_layout->close6();
if ($td_current_column == 2) {
$buffy .= $td_block_layout->close_row();
}
break;
case ‘3’: //three column layout
$buffy .= $td_block_layout->open_row();
$buffy .= $td_block_layout->open4();
$buffy .= $td_module_1->render($post);
$buffy .= $td_block_layout->close4();
if ($td_current_column == 3) {
$buffy .= $td_block_layout->close_row();
}
break;
}
//current column
if ($td_current_column == $td_column_number) {
$td_current_column = 1;
} else {
$td_current_column++;
}
$td_post_count++;
}
}
$buffy .= $td_block_layout->close_all_tags();
return $buffy;
}
}
This is the code for sharing social icons:
<?php if (function_exists(“essb_custom_position_draw”)) { essb_custom_position_draw(positionID, alwaysShow); } ?>
my question is: in which position should this code be inserted?
Hi Calin,
Maybe I did not say it clear enough. Basically he would like to insert the social sharing buttons in the previews of the home page blocks (block 3). I would like to insert them here where there are arrows —— https://ibb.co/db6frcJ
link Home page— http://www.ilgiornaleditrani.net
Hello Calin.
I asked the support of the Easy Social Share Buttons plugin for the question of social icons to be included in the preview of the articles and they answered me in this way:
“—-Thanks for reaching us. The plugin offers a variety of options for custom integration. But all that will require to deal with code. The Newspaper theme and its modules do not allow extending with ease. All they require code editing in theme source files.
The most used method of integration is with custom positions -> https://docs.socialsharingplugin.com/knowledgebase/creating-custom-displays-positions-for-share-buttons-and-how-to-use-them/. Those custom positions you can easily call in a theme source file (if you know the place).
So if you are aware (or ask theme support) where you can add code to execute in the display of posts on the homepage you will be able to integrate the share buttons with the plugin using the above feature. Otherwise, it is not possible.
If the Newspaper builder and modules are changed to allow filters and actions for easy code adding we have another option that you can use.”
Note: I am a beginner. can you please help me? Can you tell me what to do? thank you. 🙂
Non è possibile inserire il codice al tema oppure tramite un plugin? Perché questa cosa mi sembra molto limitata.
Non esiste un modo diverso? Magari inserendo del codice.
Grazie. Ma non esiste un modo diverso per visualizzare anche il commento?