Risultati della ricerca per 'Footer wordpress code'

Stai vedendo 15 risultati - da 46 a 60 (di 63 totali)
  • Moderator Cristiano Zanca

    (@cristianozanca)

    Buongiorno

    prima di fare ogni modifica fare sempre un CHILD THEME

    Successivamente all’interno del nuovo file functions.php del child scrivere un filtro tipo questo:

    http://codepad.org/TtG0LWBP

    Bisogna verificare se basta filtrare solo la funzione restaurantz_footer_copyright

    • Samuel

      (@samueleronzani)


      Buongiorno a tutti,
      MI trovo in un vicolo cieco perchè vorrei modificare il footer del tema togliendo: Powered by WordPress | Restaurantz by WEN Themes, ho provato con alcuni suggerimenti trovati su internet, ma non riesco proprio a modificarlo.

      Vi inserisco il codice che trovo all’interno del file footer.php

      http://codepad.org/dvZ4B7eJ

      Avete delle soluzioni?

      • Questo topic è stato modificato 9 anni, 8 mesi fa da Samuel.
      • Questo topic è stato modificato 9 anni, 8 mesi fa da Cristiano Zanca.
    • Ciao a tutti.
      Sono un nuovo utente, e un quasi nuovo utilizzatore di WordPress.
      Sto facendo delle prove su un template gratuito, per iniziare a “mordere” il prodotto.

      Ho seguito un tutorial che mi permetteva di inserire delle librerie nel mio template (bootstrap e font-awesome) ed è andato tutto liscio.
      Adesso volevo aggiungere una libreria javascript per fare delle “progress bar circolari”, ma non riesco a farlo funzionare.
      Posto il codice che ho usato per inserire le librerie nel template (function.php)…

      /*integrazione dei files di bootstrap e del blocco di font Awesome */
      function theme_add_bootstrap() {
          wp_enqueue_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', array('jquery'), '1.11.3', true); // aggiungere la libreria JQuery
          wp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/bootstrap/css/bootstrap.css' );
          wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/bootstrap/js/bootstrap.js', array(), '3.3.6', true );
          wp_enqueue_script( 'bootwidget', get_template_directory_uri() . '/bootstrap/js/boot-widget.js', array(), '3.3.6', true );
          wp_enqueue_style ('bootstrapstyle', get_template_directory_uri() . '/bootstrap/css/bootstrapstyle.css');
          wp_enqueue_style( 'font-awesome',  get_template_directory_uri() . '/font-awesome/css/font-awesome.min.css' );
      /* Script per le barre di avvnzamento circolare */
          wp_enqueue_script( 'progressbar', get_template_directory_uri() . '/js/progressbar.js',array(),'1.0.0', true);
      }
        
      add_action( 'wp_enqueue_scripts', 'theme_add_bootstrap' );

      qui il css (contenuto in uno dei file già dichiarati quindi già funzionante)

      /* contenitore delle barre circolari di avanzamento */
      #circularbar {
        margin: 20px;
        width: 200px;
        height: 200px;
        position: relative;
      }

      Qui la chiamata al tutto sulla pagina php

      <div id=”circularbar”>qui la barra circolare animata</div>

      seguendo un altro tutorial, ho letto che la chiamata al codice javascript può essere fatto comodamente nella pagina (o nel footer) attraverso il comando <script></script> di hatml…
      e io l’ho messo nel footer…

      http://codepad.org/EipkT4no

      inserendolo esattamente prima della chiusura del footer.

      potete dirmi se è corretto e se non lo è come aggiustarlo?
      Non funziona , dato che non fa vedere la barra circolare.

      grazie

      • Questo topic è stato modificato 9 anni, 8 mesi fa da Cristiano Zanca. Motivo: progressbar, javascript
    Moderator Cristiano Zanca

    (@cristianozanca)

    Con quelle stringhe viene richiamato il file style.css del child theme dentro il quale c’è il nome del file padre.

    prova una cosa come questa :

    function my_footer_credits() {
    	metti qui il testo 
    }
    
    function check_footer_credits(){
        remove_action( 'theshop_footer', 'theshop_footer_credits' );
        add_action( 'theshop_footer', 'my_footer_credits' );
    }
    add_action( 'after_setup_theme', 'check_footer_credits' );
    

    e facci sapere com’è andata.

    questa è la documentazione per le azioni usate

    http://codex.wordpress.org/Function_Reference/remove_action
    http://codex.wordpress.org/Function_Reference/add_action

    Moderator Cristiano Zanca

    (@cristianozanca)

    Ciao @fmartin10 ,

    nel tuo child theme sei libero di fare ciò che WP e il tema padre ti permettono di fare, è un tema a tutti gli effetti, a cui devi agganciare il padre.

    per modificare il footer puoi scrivere nel functions.php del child theme:

    function check_footer_credits(){
        remove_action( 'init', 'theshop_footer_credits' );
        add_action( 'init', 'my_footer_credits' );
    }
    add_action( 'after_setup_theme', 'check_footer_credits' );

    e poi devi dichiarare la tua funzione my_footer_credits

    http://wordpress.stackexchange.com/questions/91127/child-themes-over-riding-in-the-parents-theme

    il functions.php del child NON deve essere una copia del functions.php padre, mi sono spiegato forse male nel messaggio precedente.

    Può contenere anche una sola istruzione.

    Consiglio di seguire i passi del link indicato sopra

    Moderator Cristiano Zanca

    (@cristianozanca)

    Salve @fmartin10 ,

    l’autore del tema è favorevole all’editing del footer:

    https://wordpress.org/support/topic/copyright-in-the-footer?replies=4

    Non è solamente permesso attribuirsi la paternità del tema, sarebbe scorretto.

    La prima cosa da fare per modificare un tema è fare un CHILD THEME

    dentro il quale puoi modificare il file functions.php alla riga 212

    function theshop_footer_credits() {
    	echo '<a href="' . esc_url( __( 'http://wordpress.org/', 'theshop' ) ) . '">';
    		printf( __( 'Proudly powered by %s', 'theshop' ), 'WordPress' );
    	echo '</a>';
    	echo '<span class="sep"> | </span>';
    	printf( __( 'Theme: %2$s by %1$s.', 'theshop' ), 'aThemes', '<a href="http://athemes.com/theme/theshop" rel="designer">TheShop</a>' );
    }

    e li dentro scrivere il testo desiderato

    Chi ha creato la discussione enricocarli

    (@enricocarli)

    Ciao Guido,

    grazie mille per le risposte, sto capendo qualcosa forse;

    ho aggiunto nel mio file functions il seguente codice:

    
    	function custom_rewrite_listino() {
    		add_rewrite_rule(
    			'^listino/([^/]*)/?',
    			'index.php?page_id=2&veicolo=$matches[1]',
    			'top'
    		);
    		add_rewrite_rule(
    			'^listino/([^/]*)/([^/]*)/?',
    			'index.php?page_id=2&veicolo=$matches[1]&marca=$matches[2]',
    			'top'
    		);
    		add_rewrite_rule(
    			'^listino/([^/]*)/([^/]*)/([^/]*)/?',
    			'index.php?page_id=2&veicolo=$matches[1]&marca=$matches[2]&modello=$matches[3]',
    			'top'
    		);
    		add_rewrite_rule(
    			'^listino/([^/]*)/([^/]*)/([^/]*)/([^/]*)/?',
    			'index.php?page_id=2&veicolo=$matches[1]&marca=$matches[2]&modello=$matches[3]&allestimento=$matches[4]',
    			'top'
    		);
    
    		//flush_rewrite_rules();
    	}
    	add_action('init', 'custom_rewrite_listino');
    

    ho creato una pagina e l’ho chiamata “Listino”,
    le ho associato un template di pagina, col seguente codice:

    
    <?php /* Template Name: Listino */ ?>
    <?php get_header(); ?>
    <div class="row">
    	<div class="small-12 medium-8 large-8 columns">
    		<h1>Listino</h1>
    		<?php
    			$pagina_corrente = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
    			$url_listino = str_replace(get_site_url()."/", "", $pagina_corrente);
    			$url_listino2 = substr($url_listino, 0, -1);
    			$array_listino = explode('/', $url_listino2);
    			print_r($array_listino);
    		?>
    	</div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    

    ricavo un array dall’url, e con quei parametri mi estraggo dal db ciò che voglio;
    secondo te fa schifo come soluzione o può andare?

    sono alle prime armi con wordpress e anche con php =)

    grazie mille
    buona serata

    Ciao @nervino,

    si ottiene quel risultato perché il plugin utilizza l’hook wp_footer() che è posizionato prima della chiusura del tag <body>, non è relazionato in alcun modo al tag html <footer>.

    Per maggiori informazioni su wp_footer() consiglio di consultare la documentazione ufficiale.

    • Ciao a tutti, sono alle prime armi con lo sviluppo in WordPress.
      Ho creato un plugin di prova ed inserito nel file principale del plugin un codice per visualizzare una scritta nel footer, ma la scritta viene stampata dopo il div principale della pagina anziché nel footer.

      Il codice PHP nel plugin:

      <?php
      function mio_plugin_wp_footer() {
      echo 'TESTO DI PROVA NEL FOOTER';
      }
      add_action( 'wp_footer', 'mio_plugin_wp_footer' );
      ?>

      Esempio del risultato:

      <body>
      <div id="main">
      ...
      <footer> </footer>
      </div>
      TESTO DI PROVA NEL FOOTER
      </body>

      Cosa sbaglio?

      Grazie

    Moderator Guido Scialfa

    (@wido)

    Per inserire una widget area nel footer devi usare una hook e qualche funzione se il tema non te la predispone.

    Dai uno sguardo ai seguenti articoli del codex.

    1. wp_footer Per eseguire il tuo codice arbitrario all’interno del footer della pagina.
    2. register_sidebar Per registrare nuove sidebars nel tuo tema
    3. dynamic_sidebar Per creare una widget area. Codice che andrai ad inserire nella funzione agganciata a wp_footer.

    Se sei a digiuno di filtri e actions, una lettura al codex delle hooks può aiutarti.

    • Questa risposta è stata modificata 10 anni, 1 mese fa da Guido Scialfa. Motivo: missed closing tag
    • Questa risposta è stata modificata 10 anni, 1 mese fa da Guido Scialfa.
    Forum: Varie ed eventuali
    In risposta a: Widget in footer
    Chi ha creato la discussione rosabifulco23

    (@rosabifulco23)

    Ciao Cristano grazie per la disponibilità
    ho creato un tema child usando il plugin Orbisius Theme Editor e ho creato il file di testata,stile,footer e funzione.Non riesco a crearlo seguendo la procedura indicata, commetto qualche errore.Creato in questo modo avrò lo stesso effetto?
    Ho inserito il footer come mi hai consigliato, ma non riesco a cambiare il fondo inoltre non è ben centrato e il footer numero tre inserisce i widget in coda al secondo.
    Come posso risolvere il problema?
    [modificato perché informazione promozionale]

    • Questa risposta è stata modificata 10 anni, 1 mese fa da rosabifulco23.
    • Questa risposta è stata modificata 10 anni, 1 mese fa da Cristiano Zanca.
    Forum: Varie ed eventuali
    In risposta a: Widget in footer
    Moderator Cristiano Zanca

    (@cristianozanca)

    Salve @rosabifulco23 ,

    Prima di fare ogni modifca al sito fare un BACKUP

    Per personalizzare un tema ed evitare che al primo aggiornamento salti tutto, l’unico modo è fare un CHILD THEME

    Il customizer del tema in questione permette di inserire i widget in 2 posti:

    1) Primary sidebar
    2) Front Page

    quindi per aggiungere un widget nel footer bisogna scrivere codice nel CHILD THEME seguendo per esempio questi suggerimenti https://www.tipsandtricks-hq.com/how-to-add-widgets-to-wordpress-themes-footer-1033

    Moderator Cristiano Zanca

    (@cristianozanca)

    1) la creazione di un CHILD THEME serve proprio ad evitare di modificare direttamente il tema padre, “rompendolo”, in quanto si modifica quello e non il tema padre.

    Lo so che è lungo, ma è leggendo tutta la documentazione che si riesce a capire meglio 😉

    2) i temi sono in wp-content/themes e si attivano dal back-end

    3) usare firebug o inspector è fondamentale se vuoi fare siti e capire cosa succede

    4) plugin che modificano il footer sono centinaia https://wordpress.org/plugins/search.php?q=footer e anche per trovare quello giusto ci vuole pazienza 🙂

    Chi ha creato la discussione zacducati

    (@zacducati)

    Seguendo le sue indicazioni, ho trovato il file, di cui riporto il contenuto:

    <?php
    /**
    * Dashboard Administration Screen
    *
    * @package WordPress
    * @subpackage Administration
    */

    /** Load WordPress Bootstrap */
    require_once( dirname( __FILE__ ) . ‘/admin.php’ );

    /** Load WordPress dashboard API */
    require_once(ABSPATH . ‘wp-admin/includes/dashboard.php’);

    wp_dashboard_setup();

    wp_enqueue_script( ‘dashboard’ );
    if ( current_user_can( ‘edit_theme_options’ ) )
    wp_enqueue_script( ‘customize-loader’ );
    if ( current_user_can( ‘install_plugins’ ) )
    wp_enqueue_script( ‘plugin-install’ );
    if ( current_user_can( ‘upload_files’ ) )
    wp_enqueue_script( ‘media-upload’ );
    add_thickbox();

    if ( wp_is_mobile() )
    wp_enqueue_script( ‘jquery-touch-punch’ );

    $title = __(‘Dashboard’);
    $parent_file = ‘index.php’;

    $help = ‘<p>’ . __( ‘Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab in the upper corner.’ ) . ‘</p>’;

    // Not using chaining here, so as to be parseable by PHP4.
    $screen = get_current_screen();

    $screen->add_help_tab( array(
    ‘id’ => ‘overview’,
    ‘title’ => __( ‘Overview’ ),
    ‘content’ => $help,
    ) );

    // Help tabs

    $help = ‘<p>’ . __( ‘The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.’ ) . ‘</p>’;
    $help .= ‘<p>’ . __( ‘Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.’ ) . ‘</p>’;

    $screen->add_help_tab( array(
    ‘id’ => ‘help-navigation’,
    ‘title’ => __( ‘Navigation’ ),
    ‘content’ => $help,
    ) );

    $help = ‘<p>’ . __( ‘You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.’ ) . ‘</p>’;
    $help .= ‘<p>’ . __( ‘Screen Options – Use the Screen Options tab to choose which Dashboard boxes to show.’ ) . ‘</p>’;
    $help .= ‘<p>’ . __( ‘Drag and Drop – To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.’ ) . ‘</p>’;
    $help .= ‘<p>’ . __( ‘Box Controls – Click the title bar of the box to expand or collapse it. Some boxes added by plugins may have configurable content, and will show a “Configure” link in the title bar if you hover over it.’ ) . ‘</p>’;

    $screen->add_help_tab( array(
    ‘id’ => ‘help-layout’,
    ‘title’ => __( ‘Layout’ ),
    ‘content’ => $help,
    ) );

    $help = ‘<p>’ . __( ‘The boxes on your Dashboard screen are:’ ) . ‘</p>’;
    if ( current_user_can( ‘edit_posts’ ) )
    $help .= ‘<p>’ . __( ‘At A Glance – Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.’ ) . ‘</p>’;
    $help .= ‘<p>’ . __( ‘Activity – Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.’ ) . ‘</p>’;
    if ( is_blog_admin() && current_user_can( ‘edit_posts’ ) )
    $help .= ‘<p>’ . __( “Quick Draft – Allows you to create a new post and save it as a draft. Also displays links to the 5 most recent draft posts you’ve started.” ) . ‘</p>’;
    if ( ! is_multisite() && current_user_can( ‘install_plugins’ ) )
    $help .= ‘<p>’ . __( ‘WordPress News – Latest news from the official WordPress project, the WordPress Planet, and popular and recent plugins.’ ) . ‘</p>’;
    else
    $help .= ‘<p>’ . __( ‘WordPress News – Latest news from the official WordPress project, the WordPress Planet.’ ) . ‘</p>’;
    if ( current_user_can( ‘edit_theme_options’ ) )
    $help .= ‘<p>’ . __( ‘Welcome – Shows links for some of the most common tasks when setting up a new site.’ ) . ‘</p>’;

    $screen->add_help_tab( array(
    ‘id’ => ‘help-content’,
    ‘title’ => __( ‘Content’ ),
    ‘content’ => $help,
    ) );

    unset( $help );

    $screen->set_help_sidebar(
    ‘<p>‘ . __( ‘For more information:’ ) . ‘</p>’ .
    ‘<p>’ . __( ‘Documentation on Dashboard‘ ) . ‘</p>’ .
    ‘<p>’ . __( ‘Support Forums‘ ) . ‘</p>’
    );

    include( ABSPATH . ‘wp-admin/admin-header.php’ );
    ?>

    <div class=”wrap”>
    <h1><?php echo esc_html( $title ); ?></h1>

    <?php if ( has_action( ‘welcome_panel’ ) && current_user_can( ‘edit_theme_options’ ) ) :
    $classes = ‘welcome-panel’;

    $option = get_user_meta( get_current_user_id(), ‘show_welcome_panel’, true );
    // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner
    $hide = 0 == $option || ( 2 == $option && wp_get_current_user()->user_email != get_option( ‘admin_email’ ) );
    if ( $hide )
    $classes .= ‘ hidden’; ?>

    <div id=”welcome-panel” class=”<?php echo esc_attr( $classes ); ?>”>
    <?php wp_nonce_field( ‘welcome-panel-nonce’, ‘welcomepanelnonce’, false ); ?>
    “><?php _e( ‘Dismiss’ ); ?>
    <?php
    /**
    * Add content to the welcome panel on the admin dashboard.
    *
    * To remove the default welcome panel, use {@see remove_action()}:
    *
    * remove_action( ‘welcome_panel’, ‘wp_welcome_panel’ );
    *
    * @since 3.5.0
    */
    do_action( ‘welcome_panel’ );
    ?>
    </div>
    <?php endif; ?>

    <div id=”dashboard-widgets-wrap”>
    <?php wp_dashboard(); ?>
    </div><!– dashboard-widgets-wrap –>

    </div><!– wrap –>

    <?php
    require( ABSPATH . ‘wp-admin/admin-footer.php’ );

    Moderator Cristiano Zanca

    (@cristianozanca)

    Ciò che diceva @wido è verissimo: se modifichi files del tema senza fare un child, al primo aggiornamento (che ci sarà sicuramente) ti salta tutto.

    Se hai dei dubbi su come farlo: https://codex.wordpress.org/it:Temi_Child

    Ho attivato il tema per testarlo e ho trovato nel file footer.php un hook wmhook_disable_footer , quindi puoi: 1) creare il child 2) modificare la logica che ne blocca il footer

Stai vedendo 15 risultati - da 46 a 60 (di 63 totali)