• Hi,

    I wish to create a dropdown function on one of the buttons in a WordPress site. The site has been built using a customised version of the twenty twelve theme (I didn’t build it).

    The theme does not support menus however whoever built it is using a sidebar on the right side of the page.

    My problem is that my WordPress skills are extremely basic and a client wants me to convert the top button on the menu to a dropdown which links to 3 existing pages. Can anyone please help.

    The link for the page is https://accoria.co.uk/test/

    and the code I am working with is

    <?php
    /*
    Template Name: Sidebars Page
    */
    
    get_header(); ?>
    
    <div id="content">
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <h1>
    	<?php the_title(); ?>
    </h1>
    <div class="content_page">
    	<?php the_content(); ?>
    	<?php endwhile; else: ?>
    	<h1>Couldn't find what you were looking for...</h1>
    	<p>Sorry, no posts matched your criteria.</p>
    	<?php endif; ?>
    </div>
    <div class="sidebar">
    	<p class="button"><a href="#">Industries</a></p>
    	<p class="button"><a>">Vacancies</a></p>
    	<p class="button"><a>">Contact Us</a></p>
    	<p class="button"><a>">Send your CV</a></p>
    	<p class="button"><a>">Sign up for our news</a></p>
    	<p class="button"><a href="https://accoria.co.uk/">Back to Home</a></p>
    </div>
    <?php get_footer(); ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code has now been permanently damaged by the forum’s parser.]

    The one I need to convert is the Industries link.

    Thank you.

Viewing 1 replies (of 1 total)
  • Thread Starter mmairs05

    (@mmairs05)

    Sorry,

    This is the code I am working with.

    <?php
    /*
    Template Name: Sidebars Page
    */
    
    get_header(); ?>
    
    <div id="content">
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <h1>
    	<?php the_title(); ?>
    </h1>
    <div class="content_page">
    	<?php the_content(); ?>
    	<?php endwhile; else: ?>
    	<h1>Couldn't find what you were looking for...</h1>
    	<p>Sorry, no posts matched your criteria.</p>
    	<?php endif; ?>
    </div>
    <div class="sidebar">
    	<p class="button"><a href="#">Industries</a></p>
    	<p class="button"><a href="<?php echo get_permalink(136); ?>">Vacancies</a></p>
    	<p class="button"><a href="<?php echo get_permalink(59); ?>">Contact Us</a></p>
    	<p class="button"><a href="<?php echo get_permalink(213); ?>">Send your CV</a></p>
    	<p class="button"><a href="<?php echo get_permalink(216); ?>">Sign up for our news</a></p>
    	<p class="button"><a href="https://accoria.co.uk/">Back to Home</a></p>
    </div>
    <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Dropdown function for existing sidebar menu button’ is closed to new replies.